forked from M-Labs/artiq
1
0
Fork 0

LLVMIRGenerator: handle self-referential class types.

This commit is contained in:
whitequark 2015-08-27 15:40:46 -05:00
parent 71ebe1778d
commit 84e32db622
1 changed files with 3 additions and 0 deletions

View File

@ -270,6 +270,9 @@ class LLVMIRGenerator:
llty = self.llcontext.get_identified_type(name) llty = self.llcontext.get_identified_type(name)
if llty.elements is None: if llty.elements is None:
# First setting elements to [] will allow us to handle
# self-referential types.
llty.elements = []
llty.elements = [self.llty_of_type(attrtyp) llty.elements = [self.llty_of_type(attrtyp)
for attrtyp in typ.attributes.values()] for attrtyp in typ.attributes.values()]