From 76228727db6a807452338d098afc4dc85806eb50 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 13 May 2011 17:33:17 +0000 Subject: Update for LLVM 2.8. git-svn-id: http://svn.drobilla.net/resp/trunk@411 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/llvm.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/llvm.cpp') diff --git a/src/llvm.cpp b/src/llvm.cpp index ce684b1..2c80ba7 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -31,7 +31,7 @@ #include "llvm/Value.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/Assembly/AsmAnnotationWriter.h" +#include "llvm/Assembly/AssemblyAnnotationWriter.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" @@ -130,7 +130,7 @@ LLVMEngine::LLVMEngine() // Build Object type (tag only, binary compatible with any constructed thing) vector ctypes; - ctypes.push_back(PointerType::get(Type::getInt8Ty(context), NULL)); // RTTI + ctypes.push_back(PointerType::get(Type::getInt8Ty(context), 0)); // RTTI StructType* cObjectT = StructType::get(context, ctypes, false); module->addTypeName("Object", cObjectT); objectT = cObjectT; @@ -150,16 +150,16 @@ LLVMEngine::llType(const AST* t, const char* name) return NULL; } else if (AType::is_var(t)) { // Kludge for _me closure parameter, will be casted - return PointerType::get(Type::getInt8Ty(context), NULL); + 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); if (sym == "Bool") return Type::getInt1Ty(context); if (sym == "Int") return Type::getInt32Ty(context); if (sym == "Float") return Type::getFloatTy(context); - if (sym == "String") return PointerType::get(Type::getInt8Ty(context), NULL); - if (sym == "Symbol") return PointerType::get(Type::getInt8Ty(context), NULL); - if (sym == "Expr") return PointerType::get(Type::getInt8Ty(context), NULL); + if (sym == "String") return PointerType::get(Type::getInt8Ty(context), 0); + if (sym == "Symbol") return PointerType::get(Type::getInt8Ty(context), 0); + if (sym == "Expr") return PointerType::get(Type::getInt8Ty(context), 0); if (sym == "__REC") { if (!opaqueT) throw; return *opaqueT;} CTypes::const_iterator i = compiledTypes.find(sym); @@ -198,7 +198,7 @@ LLVMEngine::llType(const AST* t, const char* name) } else if (isupper(t->as_tuple()->fst()->str()[0])) { vector ctypes; - ctypes.push_back(PointerType::get(Type::getInt8Ty(context), NULL)); // RTTI + 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) { const Type* lt = llType(*i); if (!lt) @@ -253,7 +253,7 @@ LLVMEngine::compileCons(CEnv& cenv, const ATuple* type, CVal rtti, const vector< { // Find size of memory required size_t s = engine->getTargetData()->getTypeSizeInBits( - PointerType::get(Type::getInt8Ty(context), NULL)); + PointerType::get(Type::getInt8Ty(context), 0)); assert(type->begin() != type->end()); for (ATuple::const_iterator i = type->iter_at(1); i != type->end(); ++i) s += engine->getTargetData()->getTypeSizeInBits( @@ -469,7 +469,7 @@ LLVMEngine::compilePrimitive(CEnv& cenv, const ATuple* prim) Instruction::BinaryOps op = (Instruction::BinaryOps)0; if (n == "+") op = Instruction::Add; if (n == "-") op = Instruction::Sub; - if (n == "*") op = Instruction::Mul; + if (n == "*") op = isFloat ? Instruction::FMul : Instruction::Mul; if (n == "and") op = Instruction::And; if (n == "or") op = Instruction::Or; if (n == "xor") op = Instruction::Xor; -- cgit v1.2.1