aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r--src/llvm.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 06a895a..68a2a83 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -88,9 +88,9 @@ struct LLVMEngine : public Engine {
CVal compileDot(CEnv& cenv, CVal tup, int32_t index);
CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AST* t);
CVal compileGlobalGet(CEnv& cenv, const string& s, CVal v);
- void compileIfStart(CEnv& cenv, const AST* cond, const AST* type);
- void compileIfThen(CEnv& cenv, CVal thenV);
- void compileIfElse(CEnv& cenv, CVal elseV);
+ CVal compileIfStart(CEnv& cenv, const AST* cond, const AST* type);
+ CVal compileIfThen(CEnv& cenv, CVal thenV);
+ CVal compileIfElse(CEnv& cenv, CVal elseV);
CVal compileIfEnd(CEnv& cenv);
CVal compileLiteral(CEnv& cenv, const AST* lit);
CVal compilePrimitive(CEnv& cenv, const ATuple* prim);
@@ -436,7 +436,7 @@ LLVMEngine::eraseFn(CEnv& cenv, CFunc f)
llFunc(f)->eraseFromParent();
}
-void
+CVal
LLVMEngine::compileIfStart(CEnv& cenv, const AST* cond, const AST* type)
{
LLVMEngine* engine = reinterpret_cast<LLVMEngine*>(cenv.engine());
@@ -450,9 +450,10 @@ LLVMEngine::compileIfStart(CEnv& cenv, const AST* cond, const AST* type)
// Start then block
appendBlock(engine, parent, rec->thenBB);
+ return NULL;
}
-void
+CVal
LLVMEngine::compileIfThen(CEnv& cenv, CVal thenV)
{
LLVMEngine* engine = reinterpret_cast<LLVMEngine*>(cenv.engine());
@@ -467,9 +468,10 @@ LLVMEngine::compileIfThen(CEnv& cenv, CVal thenV)
// Start else block
appendBlock(engine, parent, rec->elseBB);
+ return NULL;
}
-void
+CVal
LLVMEngine::compileIfElse(CEnv& cenv, CVal elseV)
{
LLVMEngine* engine = reinterpret_cast<LLVMEngine*>(cenv.engine());
@@ -484,6 +486,7 @@ LLVMEngine::compileIfElse(CEnv& cenv, CVal elseV)
}
rec->elseBB = engine->builder.GetInsertBlock();
+ return NULL;
}
CVal
@@ -512,7 +515,7 @@ LLVMEngine::compilePrimitive(CEnv& cenv, const ATuple* prim)
ATuple::const_iterator i = prim->iter_at(1);
LLVMEngine* engine = reinterpret_cast<LLVMEngine*>(cenv.engine());
- bool isFloat = cenv.type(prim)->str() == "Float";
+ bool isFloat = (cenv.type(prim)->str() == "Float");
Value* a = llVal(resp_compile(cenv, *i++));
Value* b = llVal(resp_compile(cenv, *i++));
const string n = prim->fst()->to_symbol()->str();