diff options
Diffstat (limited to 'backend/src/llvm')
-rw-r--r-- | backend/src/llvm/llvm_gen_backend.cpp | 7 | ||||
-rw-r--r-- | backend/src/llvm/llvm_scalarize.cpp | 10 |
2 files changed, 6 insertions, 11 deletions
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index a0946ef6..3fe0cbf3 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -853,11 +853,8 @@ namespace gbe // Insert a new register for each function argument #if LLVM_VERSION_MINOR <= 1 const AttrListPtr &PAL = F.getAttributes(); - uint32_t argID = 1; // Start at one actually - for (; I != E; ++I, ++argID) { -#else - for (; I != E; ++I, ++argID) { #endif /* LLVM_VERSION_MINOR <= 1 */ + for (; I != E; ++I, ++argID) { const std::string &argName = I->getName().str(); Type *type = I->getType(); @@ -892,7 +889,7 @@ namespace gbe PointerType *pointerType = dyn_cast<PointerType>(type); // By value structure #if LLVM_VERSION_MINOR <= 1 - if (PAL.paramHasAttr(argID, Attribute::ByVal)) { + if (PAL.paramHasAttr(argID+1, Attribute::ByVal)) { #else if (I->hasByValAttr()) { #endif /* LLVM_VERSION_MINOR <= 1 */ diff --git a/backend/src/llvm/llvm_scalarize.cpp b/backend/src/llvm/llvm_scalarize.cpp index f7ef3752..bc665491 100644 --- a/backend/src/llvm/llvm_scalarize.cpp +++ b/backend/src/llvm/llvm_scalarize.cpp @@ -71,7 +71,11 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Module.h" #include "llvm/Pass.h" +#if LLVM_VERSION_MINOR <= 1 +#include "llvm/Support/IRBuilder.h" +#else #include "llvm/IRBuilder.h" +#endif /* LLVM_VERSION_MINOR <= 1 */ #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/raw_ostream.h" @@ -730,13 +734,7 @@ namespace gbe { Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); -#if LLVM_VERSION_MINOR <= 1 - const AttrListPtr &PAL = F.getAttributes(); - uint32_t argID = 1; // Start at one actually - for (; I != E; ++I, ++argID) { -#else for (; I != E; ++I) { -#endif /* LLVM_VERSION_MINOR <= 1 */ Type *type = I->getType(); if(type->isVectorTy()) |