aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-15 20:15:27 +0000
committerDavid Robillard <d@drobilla.net>2011-05-15 20:15:27 +0000
commit8cbb1c710d6c8877dfc2871dc3f068b52598a884 (patch)
treee1a7b157be12dbaafc8baee861407242595d0e4f /src/llvm.cpp
parentec6bd7cded43bfd3ba1491c8ec08eb1975334e4e (diff)
downloadresp-8cbb1c710d6c8877dfc2871dc3f068b52598a884.tar.gz
resp-8cbb1c710d6c8877dfc2871dc3f068b52598a884.tar.bz2
resp-8cbb1c710d6c8877dfc2871dc3f068b52598a884.zip
Generate code entirely via emitting flat IR (don't special case main/repl).
git-svn-id: http://svn.drobilla.net/resp/trunk@427 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r--src/llvm.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 3391cb7..c4744c3 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -78,7 +78,6 @@ struct LLVMEngine : public Engine {
virtual ~LLVMEngine();
CFunc startFn(CEnv& cenv, const string& name, const ATuple* args, const ATuple* type);
- void pushFnArgs(CEnv& cenv, const ATuple* prot, const ATuple* type, CFunc f);
void finishFn(CEnv& cenv, CVal ret, const AST* retT);
CFunc getFn(CEnv& cenv, const std::string& name);
void eraseFn(CEnv& cenv, CFunc f);
@@ -103,6 +102,8 @@ struct LLVMEngine : public Engine {
const string call(CEnv& cenv, CFunc f, const AST* retT);
private:
+ void pushFnArgs(CEnv& cenv, const ATuple* prot, const ATuple* type, CFunc f);
+
void appendBlock(LLVMEngine* engine, Function* function, BasicBlock* block) {
function->getBasicBlockList().push_back(block);
engine->builder.SetInsertPoint(block);
@@ -403,6 +404,9 @@ LLVMEngine::startFn(
builder.SetInsertPoint(bb);
currentFn = f;
+ cenv.def(cenv.penv.sym(name), NULL, type, f);
+ pushFnArgs(cenv, args, type, f);
+
return f;
}