diff options
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index e2f7f1a..9e519a7 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -16,11 +16,7 @@ */ /** @file - * @brief Compile AST to LLVM IR - * - * Compilation pass functions (lift/compile) that require direct use of LLVM - * specific things are implemented here. Generic compilation pass functions - * are implemented in compile.cpp. + * @brief Compile to LLVM IR */ #include <map> @@ -64,11 +60,10 @@ llType(const AType* t) const ATuple* prot = t->at(1)->to<const ATuple*>(); for (size_t i = 0; i < prot->size(); ++i) { const AType* at = prot->at(i)->to<const AType*>(); - const Type* lt = llType(at); - if (lt) - cprot.push_back(lt); - else + const Type* lt = llType(at); + if (!lt) return NULL; + cprot.push_back(lt); } FunctionType* fT = FunctionType::get(llType(retT), cprot, false); @@ -159,7 +154,7 @@ struct LLVMEngine : public Engine { return builder.CreateCall(llFunc(f), llArgs.begin(), llArgs.end()); } - void liftCall(CEnv& cenv, AFn* fn, const AType& argsT); + void liftCall(CEnv& cenv, AFn* fn, const AType& argsT); CValue compileLiteral(CEnv& cenv, AST* lit); CValue compilePrimitive(CEnv& cenv, APrimitive* prim); |