diff options
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 12 |
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) { |