aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-14 08:28:54 +0000
committerDavid Robillard <d@drobilla.net>2011-05-14 08:28:54 +0000
commitfedff47ebf4a1c2dd9830d2004735a74ad42ef36 (patch)
treece85f279d3cf3b85279a80842a49dcbb490c0c33 /src/llvm.cpp
parent5ca391c314ccef39597a5c412a27772f86e11889 (diff)
downloadresp-fedff47ebf4a1c2dd9830d2004735a74ad42ef36.tar.gz
resp-fedff47ebf4a1c2dd9830d2004735a74ad42ef36.tar.bz2
resp-fedff47ebf4a1c2dd9830d2004735a74ad42ef36.zip
Tidy.
git-svn-id: http://svn.drobilla.net/resp/trunk@422 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r--src/llvm.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 4bb21ec..532051e 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -178,9 +178,6 @@ LLVMEngine::llType(const AST* t, const char* name)
{
if (t == NULL) {
return NULL;
- } else if (AType::is_var(t)) {
- // Kludge for _me closure parameter, will be casted
- return PointerType::get(Type::getInt8Ty(context), 0);
} else if (AType::is_name(t)) {
const std::string sym(t->as_symbol()->sym());
if (sym == "Nothing") return Type::getVoidTy(context);
@@ -198,10 +195,13 @@ LLVMEngine::llType(const AST* t, const char* name)
CTypes::const_iterator i = compiledTypes.find(sym);
if (i != compiledTypes.end())
return i->second;
- }
- if (!AType::is_expr(t))
+ cerr << "WARNING: No low-level type for " << t << endl;
return NULL;
+ }
+
+ THROW_IF(!isupper(t->as_tuple()->fst()->str()[0]), t->loc,
+ "Lower-case type expression");
// Define opaque type to stand for name in recursive type body
if (name) {
@@ -229,7 +229,7 @@ LLVMEngine::llType(const AST* t, const char* name)
ret = FunctionType::get(llType(retT), cprot, false);
- } else if (isupper(t->as_tuple()->fst()->str()[0])) {
+ } else {
vector<const Type*> ctypes;
ctypes.push_back(PointerType::get(Type::getInt8Ty(context), 0)); // RTTI
for (ATuple::const_iterator i = t->as_tuple()->iter_at(1); i != t->as_tuple()->end(); ++i) {