returns, args, aux,
expression, block,
min_valid,
- optimizable, unimplemented, extension, perm_only, absorb_miss, no_abbrev,
- opname, mangle):
+ optimizable, unimplemented, extension, perm_only, absorb_miss, no_abbrev):
self.name = name
self.category = category
self.returns = returns
self.perm_only = perm_only
self.absorb_miss = absorb_miss
self.no_abbrev = no_abbrev
- self.opname = opname
- if mangle is not None:
- self.mangle = mangle
+
+ self.opname = ('OP_%s' % name).replace('.', '_')
+ if category == 'function':
+ self.mangle = ''.join([a.type_.mangle for a in args])
+ self.opname += '_%s' % self.mangle
def parse_input():
"""Parses the entire input.
any_arg = '|'.join([a.name for a in args])
arg.condition = re.sub(r'\b(%s)\b' % any_arg, r'arg_\1', arg.condition)
- opname = 'OP_' + name
- opname = opname.replace('.', '_')
- if category == 'function':
- mangle = ''.join([a.type_.mangle for a in args])
- opname += '_' + mangle
- else:
- mangle = None
-
aux = []
while toktype == 'id':
type_ = parse_type()
sys.stderr.write("block or expression expected\n")
sys.exit(1)
- if opname in ops:
- sys.stderr.write("duplicate operation name %s\n" % opname)
- sys.exit(1)
-
op = Op(name, category,
return_type, args, aux,
expression, block,
min_valid,
optimizable, unimplemented, extension, perm_only, absorb_miss,
- no_abbrev,
- opname, mangle)
+ no_abbrev)
+ if op.opname in ops:
+ sys.stderr.write("duplicate operation name %s\n" % op.opname)
+ sys.exit(1)
if min_valid > 0:
aa = array_arg(op)
sys.stderr.write("can't have minimu valid count if array has multiplication factor\n")
sys.exit(1)
- ops[opname] = op
+ ops[op.opname] = op
if category == 'function':
- funcs += [opname]
+ funcs += [op.opname]
else:
- opers += [opname]
+ opers += [op.opname]
in_file.close()