aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/llvm.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 437bd40..4bbc75f 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -224,9 +224,10 @@ LLVMEngine::compileCons(CEnv& cenv, const ATuple* type, CVal rtti, const vector<
s += engine->getTargetData()->getTypeSizeInBits(llType(*i));
// Allocate struct
+ const std::string name = type->fst()->str();
Value* structSize = ConstantInt::get(Type::getInt32Ty(context), bitsToBytes(s));
- Value* mem = builder.CreateCall(alloc, structSize, "tupMem");
- Value* structPtr = builder.CreateBitCast(mem, llType(type), "tup");
+ Value* mem = builder.CreateCall(alloc, structSize, name + "_mem");
+ Value* structPtr = builder.CreateBitCast(mem, llType(type), name);
// Set struct fields
if (rtti)