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 1b01e4d..30927d4 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -46,12 +46,12 @@ static const Type* llType(const AType* t) { if (t->kind == AType::PRIM) { - if (t->at(0)->str() == "Nothing") return Type::VoidTy; - if (t->at(0)->str() == "Bool") return Type::Int1Ty; - if (t->at(0)->str() == "Int") return Type::Int32Ty; - if (t->at(0)->str() == "Float") return Type::FloatTy; + if (t->head()->str() == "Nothing") return Type::VoidTy; + if (t->head()->str() == "Bool") return Type::Int1Ty; + if (t->head()->str() == "Int") return Type::Int32Ty; + if (t->head()->str() == "Float") return Type::FloatTy; throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'"); - } else if (t->kind == AType::EXPR && t->at(0)->str() == "Fn") { + } else if (t->kind == AType::EXPR && t->head()->str() == "Fn") { const AType* retT = t->at(2)->as<const AType*>(); if (!llType(retT)) return NULL; @@ -339,7 +339,7 @@ LLVMEngine::compilePrimitive(CEnv& cenv, APrimitive* prim) Value* a = llVal(prim->at(1)->compile(cenv)); Value* b = llVal(prim->at(2)->compile(cenv)); bool isFloat = cenv.type(prim->at(1))->str() == "Float"; - const string n = prim->at(0)->to<ASymbol*>()->str(); + const string n = prim->head()->to<ASymbol*>()->str(); // Binary arithmetic operations Instruction::BinaryOps op = (Instruction::BinaryOps)0; |