diff options
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index c3f4d2c..de53baa 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -73,11 +73,11 @@ struct LLVMEngine : public Engine { CVal compileLiteral(CEnv& cenv, const AST* lit); CVal compilePrimitive(CEnv& cenv, const ATuple* prim); CVal compileString(CEnv& cenv, const char* str); - + void writeModule(CEnv& cenv, std::ostream& os); const string call(CEnv& cenv, CFunc f, const AType* retT); - + private: typedef pair<Value*, BasicBlock*> IfBranch; typedef vector<IfBranch> IfBranches; @@ -93,7 +93,7 @@ private: function->getBasicBlockList().push_back(block); engine->builder.SetInsertPoint(block); } - + inline Value* llVal(CVal v) { return static_cast<Value*>(v); } inline Function* llFunc(CFunc f) { return static_cast<Function*>(f); } const Type* llType(const AType* t); @@ -304,7 +304,7 @@ LLVMEngine::pushFnArgs(CEnv& cenv, const ATuple* prot, const AType* type, CFunc const AType* argsT = type->prot()->as_type(); Function* f = llFunc(cfunc); - + // Bind argument values in CEnv ATuple::const_iterator p = prot->begin(); ATuple::const_iterator pT = argsT->begin(); @@ -361,7 +361,7 @@ LLVMEngine::compileIfBranch(CEnv& cenv, IfState s, CVal condV, const AST* then) Value* thenV = llVal(resp_compile(cenv, then)); engine->builder.CreateBr(state->mergeBB); state->branches.push_back(make_pair(thenV, thenBB)); - + appendBlock(engine, state->parent, nextBB); } |