Fix the build with LLVM 3.3 and enable building the optimisation passes by

default of LLVM 3.3 is found.
main
theraven 13 years ago
parent 383ccff079
commit 3b44e6f97a

@ -130,7 +130,7 @@ if (DEFAULT_ENABLE_LLVM)
set(DEFAULT_ENABLE_LLVM FALSE) set(DEFAULT_ENABLE_LLVM FALSE)
message(STATUS "svn version of LLVM found.") message(STATUS "svn version of LLVM found.")
message(STATUS "Disabling LLVM options unless explicitly enabled.") message(STATUS "Disabling LLVM options unless explicitly enabled.")
elseif (LLVM_VER VERSION_GREATER 3.2) elseif (LLVM_VER VERSION_GREATER 3.3)
set(DEFAULT_ENABLE_LLVM FALSE) set(DEFAULT_ENABLE_LLVM FALSE)
message(STATUS "Untested version of LLVM (${LLVM_VER}) found.") message(STATUS "Untested version of LLVM (${LLVM_VER}) found.")
message(STATUS "Disabling LLVM options unless explicitly enabled.") message(STATUS "Disabling LLVM options unless explicitly enabled.")

@ -14,7 +14,7 @@ namespace
{ {
class ClassIMPCachePass : public ModulePass class ClassIMPCachePass : public ModulePass
{ {
LLVMIntegerType *IntTy; LLVMIntegerTy *IntTy;
public: public:
static char ID; static char ID;

@ -25,9 +25,9 @@ namespace GNUstep
MDNode *AlreadyCachedFlag; MDNode *AlreadyCachedFlag;
unsigned IMPCacheFlagKind; unsigned IMPCacheFlagKind;
Pass *Owner; Pass *Owner;
LLVMPointerType *PtrTy; LLVMPointerTy *PtrTy;
LLVMPointerType *IdTy; LLVMPointerTy *IdTy;
LLVMIntegerType *IntTy; LLVMIntegerTy *IntTy;
public: public:
IMPCacher(LLVMContext &C, Pass *owner); IMPCacher(LLVMContext &C, Pass *owner);
void CacheLookup(Instruction *lookup, Value *slot, Value *version, bool void CacheLookup(Instruction *lookup, Value *slot, Value *version, bool

@ -157,16 +157,16 @@ llvm::Constant* GetConstantStruct(llvm::LLVMContext &C, const std::vector<llvm::
#if LLVM_MAJOR < 3 #if LLVM_MAJOR < 3
typedef const llvm::Type LLVMType; typedef const llvm::Type LLVMType;
typedef const llvm::StructType LLVMStructType; typedef const llvm::StructType LLVMStructTy;
typedef const llvm::ArrayType LLVMArrayType; typedef const llvm::ArrayType LLVMArrayTy;
typedef const llvm::PointerType LLVMPointerType; typedef const llvm::PointerType LLVMPointerTy;
typedef const llvm::IntegerType LLVMIntegerType; typedef const llvm::IntegerType LLVMIntegerTy;
#else #else
typedef llvm::Type LLVMType; typedef llvm::Type LLVMType;
typedef llvm::StructType LLVMStructType; typedef llvm::StructType LLVMStructTy;
typedef llvm::ArrayType LLVMArrayType; typedef llvm::ArrayType LLVMArrayTy;
typedef llvm::PointerType LLVMPointerType; typedef llvm::PointerType LLVMPointerTy;
typedef llvm::IntegerType LLVMIntegerType; typedef llvm::IntegerType LLVMIntegerTy;
#endif #endif
#endif #endif

@ -14,7 +14,7 @@ namespace
class GNULoopIMPCachePass : public FunctionPass class GNULoopIMPCachePass : public FunctionPass
{ {
GNUstep::IMPCacher *cacher; GNUstep::IMPCacher *cacher;
LLVMIntegerType *IntTy; LLVMIntegerTy *IntTy;
Module *M; Module *M;
bool skip; bool skip;
Function *sendFn; Function *sendFn;

@ -12,7 +12,7 @@ namespace {
typedef std::vector<callPair > replacementVector; typedef std::vector<callPair > replacementVector;
static char ID; static char ID;
uint32_t callsiteCount; uint32_t callsiteCount;
LLVMIntegerType *Int32Ty; LLVMIntegerTy *Int32Ty;
GNUObjCTypeFeedback() : ModulePass(ID), callsiteCount(0) {} GNUObjCTypeFeedback() : ModulePass(ID), callsiteCount(0) {}
void profileFunction(Function &F, Constant *ModuleID) { void profileFunction(Function &F, Constant *ModuleID) {
@ -47,7 +47,7 @@ namespace {
{ {
LLVMContext &VMContext = M.getContext(); LLVMContext &VMContext = M.getContext();
Int32Ty = IntegerType::get(VMContext, 32); Int32Ty = IntegerType::get(VMContext, 32);
LLVMPointerType *PtrTy = Type::getInt8PtrTy(VMContext); LLVMPointerTy *PtrTy = Type::getInt8PtrTy(VMContext);
Constant *moduleName = Constant *moduleName =
#if (LLVM_MAJOR > 3) || ((LLVM_MAJOR == 3) && (LLVM_MINOR > 0)) #if (LLVM_MAJOR > 3) || ((LLVM_MAJOR == 3) && (LLVM_MINOR > 0))
ConstantDataArray::getString(VMContext, M.getModuleIdentifier(), true); ConstantDataArray::getString(VMContext, M.getModuleIdentifier(), true);

Loading…
Cancel
Save