diff options
author | David Robillard <d@drobilla.net> | 2012-12-25 08:35:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-25 08:35:43 +0000 |
commit | 77d27b3495bfa98c5e13707903e4f885e8521ab6 (patch) | |
tree | b2cadb927fd0ab8732001fc77a580f1dffcd0744 /src/llvm.cpp | |
parent | 12314c754187ae246bc38aceb827bf51d1669d73 (diff) | |
download | resp-77d27b3495bfa98c5e13707903e4f885e8521ab6.tar.gz resp-77d27b3495bfa98c5e13707903e4f885e8521ab6.tar.bz2 resp-77d27b3495bfa98c5e13707903e4f885e8521ab6.zip |
Support multiple ellipses in macros.
Support lambda expressions with empty argument lists.
git-svn-id: http://svn.drobilla.net/resp/trunk@445 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index 2bd1930..3110c72 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -184,7 +184,7 @@ LLVMEngine::~LLVMEngine() Type* LLVMEngine::llType(const AST* t, const char* name) { - if (t == NULL) { + if (t == NULL || AType::is_var(t)) { return NULL; } else if (AType::is_name(t)) { const std::string sym(t->as_symbol()->sym()); @@ -207,8 +207,8 @@ LLVMEngine::llType(const AST* t, const char* name) return NULL; } - THROW_IF(!isupper(t->as_tuple()->fst()->str()[0]), t->loc, - "Lower-case type expression"); + THROW_IF(t->as_tuple()->fst() && !isupper(t->as_tuple()->fst()->str()[0]), + t->loc, "Lower-case type expression"); // Function type if (is_form(t, "Fn")) { @@ -414,12 +414,14 @@ LLVMEngine::compileProt( Function::LinkageTypes linkage = Function::ExternalLinkage; vector<Type*> cprot; - for (const auto& i : *argsT) { - const CType iT = (i->to_symbol()) - ? compileType(cenv, i->str(), cenv.resolveType(i)) - : compileType(cenv, i->as_tuple()->fst()->str(), i); - THROW_IF(!iT, Cursor(), string("non-concrete parameter :: ") + i->str()); - cprot.push_back((Type*)iT); + if (argsT) { + for (const auto& i : *argsT) { + const CType iT = (i->to_symbol()) + ? compileType(cenv, i->str(), cenv.resolveType(i)) + : compileType(cenv, i->as_tuple()->fst()->str(), i); + THROW_IF(!iT, Cursor(), string("non-concrete parameter :: ") + i->str()); + cprot.push_back((Type*)iT); + } } THROW_IF(!llType(retT), Cursor(), |