aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r--src/llvm.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 8dee633..939eeeb 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -131,14 +131,16 @@ LLVMEngine::llType(const AType* t)
{
if (t == NULL) {
return NULL;
- } else if (t->kind == AType::PRIM) {
+ } else if (t->kind == AType::VAR) {
+ // Kludge for _me closure parameter, will be casted
+ return PointerType::get(Type::getInt8Ty(context), NULL);
+ } else if (t->kind == AType::NAME) {
if (t->head()->str() == "Nothing") return Type::getVoidTy(context);
if (t->head()->str() == "Bool") return Type::getInt1Ty(context);
if (t->head()->str() == "Int") return Type::getInt32Ty(context);
if (t->head()->str() == "Float") return Type::getFloatTy(context);
if (t->head()->str() == "String") return PointerType::get(Type::getInt8Ty(context), NULL);
if (t->head()->str() == "Quote") return PointerType::get(Type::getInt8Ty(context), NULL);
- throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'");
} else if (t->kind == AType::EXPR && t->head()->str() == "Fn") {
AType::const_iterator i = t->begin();
const ATuple* protT = (*++i)->to_tuple();
@@ -166,11 +168,8 @@ LLVMEngine::llType(const AType* t)
}
return PointerType::get(StructType::get(context, ctypes, false), 0);
- } else if (t->kind == AType::NAME) {
- assert(false);
}
- assert(false);
- return PointerType::get(Type::getInt8Ty(context), NULL);
+ return NULL;
}
/** Convert a size in bits to bytes, rounding up as necessary */