diff --git a/gen/nested.cpp b/gen/nested.cpp index 61c6710f..810d8652 100644 --- a/gen/nested.cpp +++ b/gen/nested.cpp @@ -431,8 +431,8 @@ void DtoCreateNestedContext(FuncDeclaration* fd) { } } - // Append current frame type to frame type list const LLStructType* frameType = LLStructType::get(types); + gIR->module->addTypeName(std::string("nest.") + fd->toChars(), frameType); Logger::cout() << "frameType = " << *frameType << '\n'; diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 80f64b74..fd9dd5f9 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -100,13 +100,17 @@ const LLType* DtoType(Type* t) case Tarray: { t->irtype = new IrTypeArray(t); - return t->irtype->get(); + const LLType* arrty = t->irtype->get(); + gIR->module->addTypeName(t->toChars(), arrty); + return arrty; } case Tsarray: { t->irtype = new IrTypeSArray(t); - return t->irtype->get(); + const LLType* arrty = t->irtype->get(); + gIR->module->addTypeName(t->toChars(), arrty); + return arrty; } // aggregates @@ -232,7 +236,9 @@ const LLStructType* DtoDelegateType(Type* t) const LLType* i8ptr = getVoidPtrType(); const LLType* func = DtoFunctionType(t->nextOf(), NULL, Type::tvoid->pointerTo()); const LLType* funcptr = getPtrToType(func); - return LLStructType::get(i8ptr, funcptr, NULL); + const LLStructType* dgtype = LLStructType::get(i8ptr, funcptr, NULL); + gIR->module->addTypeName(t->toChars(), dgtype); + return dgtype; } //////////////////////////////////////////////////////////////////////////////////////////