diff options
author | Chia-I Wu <[email protected]> | 2010-12-15 03:33:30 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-24 17:28:51 +0800 |
commit | 86d29eab48b4ec8a972eec8a2a8179b5386a069e (patch) | |
tree | 75bae6adeb8977270440a6b2fe21ae50eeec02d7 /src | |
parent | 876effb0e717e8e64050662f6ffa286c22065f5c (diff) |
mapi: Store alias entry instead of alias name.
An entry can hold more info than plain name.
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/mapi/mapi_abi.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mapi/mapi/mapi_abi.py b/src/mapi/mapi/mapi_abi.py index 3a872666f96..c295574b1ef 100644 --- a/src/mapi/mapi/mapi_abi.py +++ b/src/mapi/mapi/mapi_abi.py @@ -166,10 +166,13 @@ def abi_parse(filename): # post-process attributes if attrs['alias']: try: - ent = entry_dict[attrs['alias']] - slot = ent.slot + alias = entry_dict[attrs['alias']] except KeyError: raise Exception('failed to alias %s' % attrs['alias']) + if alias.alias: + raise Exception('recursive alias %s' % ent.name) + slot = alias.slot + attrs['alias'] = alias else: slot = next_slot next_slot += 1 @@ -194,7 +197,7 @@ def abi_parse(filename): raise Exception('entries are not ordered by slots') if entries[i].alias: raise Exception('first entry of slot %d aliases %s' - % (slot, entries[i].alias)) + % (slot, entries[i].alias.name)) while i < len(entries) and entries[i].slot == slot: i += 1 if i < len(entries): @@ -374,7 +377,6 @@ class ABIPrinter(object): def c_asm_gcc(self, prefix): asm = [] - to_name = None asm.append('__asm__(') for ent in self.entries: @@ -385,11 +387,11 @@ class ABIPrinter(object): if ent.alias: asm.append('".globl %s\\n"' % (name)) - asm.append('".set %s, %s\\n"' % (name, to_name)) + asm.append('".set %s, %s\\n"' % (name, + prefix + ent.alias.name)) else: asm.append('STUB_ASM_ENTRY("%s")"\\n"' % (name)) asm.append('"\\t"STUB_ASM_CODE("%d")"\\n"' % (ent.slot)) - to_name = name asm.append(');') return "\n".join(asm) |