aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-13 17:33:17 +0000
committerDavid Robillard <d@drobilla.net>2011-05-13 17:33:17 +0000
commit76228727db6a807452338d098afc4dc85806eb50 (patch)
tree175fbb3ea9e74b010342ba1d8f75e33ff06569e8
parent526810d5387bf32f2e7a0b5c3be4611eb5f633ac (diff)
downloadresp-76228727db6a807452338d098afc4dc85806eb50.tar.gz
resp-76228727db6a807452338d098afc4dc85806eb50.tar.bz2
resp-76228727db6a807452338d098afc4dc85806eb50.zip
Update for LLVM 2.8.
git-svn-id: http://svn.drobilla.net/resp/trunk@411 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--Makefile8
-rw-r--r--src/llvm.cpp18
2 files changed, 13 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 8f09df3..7678e1a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-LLVM_CXXFLAGS=`llvm-config-2.7 --cppflags core jit native codegen ipo`
-LLVM_LDFLAGS=`llvm-config-2.7 --ldflags --libs core jit native codegen ipo`
-#LLVM_CXXFLAGS=`llvm-config-2.7 --cppflags all`
-#LLVM_LDFLAGS=`llvm-config-2.7 --ldflags --libs all`
+LLVM_CXXFLAGS=`llvm-config-2.8 --cppflags core jit native codegen ipo`
+LLVM_LDFLAGS=`llvm-config-2.8 --ldflags --libs core jit native codegen ipo`
+#LLVM_CXXFLAGS=`llvm-config-2.8 --cppflags all`
+#LLVM_LDFLAGS=`llvm-config-2.8 --ldflags --libs all`
COMMON_FLAGS=-fPIC
COMMON_FLAGS+=-Wall -Wextra -Wno-unused-parameter
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<const Type*> 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<const Type*> 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;