From ff0ab736e9c41170670743c1ed71b444c58ab0b7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 31 Dec 2015 22:36:17 +0800 Subject: [PATCH] Commit missing parts of 8aa34ee9. --- .../compiler/transforms/artiq_ir_generator.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index 3eb05a0a0..4212400df 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1445,18 +1445,20 @@ class ARTIQIRGenerator(algorithm.Visitor): # Keep this function with builtins.TException.attributes. def alloc_exn(self, typ, message=None, param0=None, param1=None, param2=None): + typ = typ.find() attributes = [ - ir.Constant(typ.find().name, ir.TExceptionTypeInfo()), # typeinfo - ir.Constant("", builtins.TStr()), # file - ir.Constant(0, builtins.TInt32()), # line - ir.Constant(0, builtins.TInt32()), # column - ir.Constant("", builtins.TStr()), # function + ir.Constant("{}:{}".format(typ.id, typ.name), + ir.TExceptionTypeInfo()), # typeinfo + ir.Constant("", builtins.TStr()), # file + ir.Constant(0, builtins.TInt32()), # line + ir.Constant(0, builtins.TInt32()), # column + ir.Constant("", builtins.TStr()), # function ] if message is None: - attributes.append(ir.Constant(typ.find().name, builtins.TStr())) + attributes.append(ir.Constant(typ.name, builtins.TStr())) else: - attributes.append(message) # message + attributes.append(message) # message param_type = builtins.TInt64() for param in [param0, param1, param2]: @@ -1465,7 +1467,7 @@ class ARTIQIRGenerator(algorithm.Visitor): else: if param.type != param_type: param = self.append(ir.Coerce(param, param_type)) - attributes.append(param) # paramN, N=0:2 + attributes.append(param) # paramN, N=0:2 return self.append(ir.Alloc(attributes, typ))