aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-20 18:21:12 +0000
committerDavid Robillard <d@drobilla.net>2009-06-20 18:21:12 +0000
commit2c8d949da599dacd7676ea49010e8a739845bac4 (patch)
tree17251fdf7632cca668ad91b99eafce39c6c92c53
parentced439fb6918e8848882d0e3a65f11b72da92425 (diff)
downloadresp-2c8d949da599dacd7676ea49010e8a739845bac4.tar.gz
resp-2c8d949da599dacd7676ea49010e8a739845bac4.tar.bz2
resp-2c8d949da599dacd7676ea49010e8a739845bac4.zip
Fix building with explicit stack frames.
Tidy. git-svn-id: http://svn.drobilla.net/resp/tuplr@134 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--llvm.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm.cpp b/llvm.cpp
index dbe647b..5024f85 100644
--- a/llvm.cpp
+++ b/llvm.cpp
@@ -286,6 +286,8 @@ AClosure::liftCall(CEnv& cenv, const AType& argsT)
#ifdef EXPLICIT_STACK_FRAMES
+ IRBuilder<> builder = llengine(cenv)->builder;
+
// Scan out definitions
for (size_t i = 0; i < size(); ++i) {
ADefinition* def = at(i)->to<ADefinition*>();
@@ -298,15 +300,11 @@ AClosure::liftCall(CEnv& cenv, const AType& argsT)
}
// Create stack frame
- StructType* frameT = StructType::get(types, false);
- PointerType* framePtrT = PointerType::get(frameT, 0);
-
- Value* tag = ConstantInt::get(Type::Int8Ty, (uint8_t)GC::TAG_FRAME);
-
- Value* frameSize = ConstantInt::get(Type::Int32Ty, s / 8);
- Value* frame = builder.CreateCall2(llVal(cenv.alloc), frameSize, tag, "frame");
-
- Value* framePtr = builder.CreateBitCast(frame, framePtrT, "frameptr");
+ StructType* frameT = StructType::get(types, false);
+ Value* tag = ConstantInt::get(Type::Int8Ty, GC::TAG_FRAME);
+ Value* frameSize = ConstantInt::get(Type::Int32Ty, s / 8);
+ Value* frame = builder.CreateCall2(llVal(cenv.alloc), frameSize, tag, "frame");
+ Value* framePtr = builder.CreateBitCast(frame, PointerType::get(frameT, 0));
// Bind parameter values in stack frame
i = 2;