diff options
author | David Robillard <d@drobilla.net> | 2009-10-14 00:06:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-14 00:06:45 +0000 |
commit | ba3406f78e20f2e6a7fd6dbe28eb8de553cec9ae (patch) | |
tree | 0116ad645e8557a5bb65251e63f0c8333defcb86 /src/llvm.cpp | |
parent | 6b89f484b7e41cab4a528a855b23be33d97dc474 (diff) | |
download | resp-ba3406f78e20f2e6a7fd6dbe28eb8de553cec9ae.tar.gz resp-ba3406f78e20f2e6a7fd6dbe28eb8de553cec9ae.tar.bz2 resp-ba3406f78e20f2e6a7fd6dbe28eb8de553cec9ae.zip |
Remove cruft.
git-svn-id: http://svn.drobilla.net/resp/tuplr@215 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index 34f23ca..1477917 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -259,15 +259,6 @@ LLVMEngine::compileFunction(CEnv& cenv, AFn* fn, const AType& argsT) Subst oldSubst = cenv.tsubst; cenv.tsubst = Subst::compose(cenv.tsubst, Subst::compose(argsSubst, fn->subst)); -//#define EXPLICIT_STACK_FRAMES 1 - -#ifdef EXPLICIT_STACK_FRAMES - vector<const Type*> types; - types.push_back(Type::Int8Ty); - types.push_back(Type::Int8Ty); - size_t s = 16; // stack frame size in bits -#endif - // Bind argument values in CEnv vector<Value*> args; AFn::const_iterator p = fn->prot()->begin(); @@ -277,40 +268,7 @@ LLVMEngine::compileFunction(CEnv& cenv, AFn* fn, const AType& argsT) const Type* lt = llType(t); THROW_IF(!lt, fn->loc, "untyped parameter\n"); cenv.def((*p)->as<ASymbol*>(), *p, t, &*a); -#ifdef EXPLICIT_STACK_FRAMES - types.push_back(lt); - s += std::max(lt->getPrimitiveSizeInBits(), unsigned(8)); -#endif - } - -#ifdef EXPLICIT_STACK_FRAMES - IRBuilder<> builder = engine->builder; - - // Scan out definitions - for (size_t i = 0; i < size(); ++i) { - ADef* def = at(i)->to<ADef*>(); - if (def) { - const Type* lt = llType(cenv.type(def->at(2))); - THROW_IF(!lt, loc, "untyped definition\n"); - types.push_back(lt); - s += std::max(lt->getPrimitiveSizeInBits(), unsigned(8)); - } - } - - // Create stack frame - 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(engine->alloc, frameSize, tag, "frame"); - Value* framePtr = builder.CreateBitCast(frame, PointerType::get(frameT, 0)); - - // Bind parameter values in stack frame - i = 2; - for (Function::arg_iterator a = f->arg_begin(); a != f->arg_end(); ++a, ++i) { - Value* v = builder.CreateStructGEP(framePtr, i, "arg"); - builder.CreateStore(&*a, v); } -#endif // Write function body try { |