diff options
author | David Robillard <d@drobilla.net> | 2009-10-06 22:43:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-06 22:43:47 +0000 |
commit | 5cfabba03b2fa414c6904f7986dd6b08c409bfae (patch) | |
tree | c8572c6485a01ecf3493e0a92d48b80604287784 /src/llvm.cpp | |
parent | e59c3164288378f89131699eee19884e5f87711e (diff) | |
download | resp-5cfabba03b2fa414c6904f7986dd6b08c409bfae.tar.gz resp-5cfabba03b2fa414c6904f7986dd6b08c409bfae.tar.bz2 resp-5cfabba03b2fa414c6904f7986dd6b08c409bfae.zip |
C backend.
git-svn-id: http://svn.drobilla.net/resp/tuplr@199 ad02d1e2-f140-0410-9f75-f8b11f17cedd
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); |