Enabling llvm 3.4

This commit is contained in:
Dmitry Babokin
2013-05-13 19:25:31 +04:00
parent d958b0b9d6
commit b6b9daa3c5
7 changed files with 21 additions and 21 deletions

View File

@@ -725,7 +725,7 @@ lDefineConstantIntFunc(const char *name, int val, llvm::Module *module,
Assert(func != NULL); // it should be declared already... Assert(func != NULL); // it should be declared already...
#if defined(LLVM_3_2) #if defined(LLVM_3_2)
func->addFnAttr(llvm::Attributes::AlwaysInline); func->addFnAttr(llvm::Attributes::AlwaysInline);
#else #else // LLVM 3.1 and 3.3+
func->addFnAttr(llvm::Attribute::AlwaysInline); func->addFnAttr(llvm::Attribute::AlwaysInline);
#endif #endif
llvm::BasicBlock *bblock = llvm::BasicBlock::Create(*g->ctx, "entry", func, 0); llvm::BasicBlock *bblock = llvm::BasicBlock::Create(*g->ctx, "entry", func, 0);

View File

@@ -88,10 +88,10 @@
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
#include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/GetElementPtrTypeIterator.h"
#if defined(LLVM_3_3) #if defined(LLVM_3_1) || defined(LLVM_3_2)
#include "llvm/InstVisitor.h"
#else
#include "llvm/Support/InstVisitor.h" #include "llvm/Support/InstVisitor.h"
#else // LLVM 3.3+
#include "llvm/InstVisitor.h"
#endif #endif
#include "llvm/Support/MathExtras.h" #include "llvm/Support/MathExtras.h"
#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetRegistry.h"

View File

@@ -3293,7 +3293,7 @@ FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType,
// alias analysis. // alias analysis.
// TODO: what other attributes needs to be copied? // TODO: what other attributes needs to be copied?
// TODO: do the same for varing path. // TODO: do the same for varing path.
#if defined (LLVM_3_3) #if !defined (LLVM_3_1) && !defined (LLVM_3_2) // LLVM 3.3+
llvm::CallInst *cc = llvm::dyn_cast<llvm::CallInst>(ci); llvm::CallInst *cc = llvm::dyn_cast<llvm::CallInst>(ci);
if (cc && if (cc &&
cc->getCalledFunction() && cc->getCalledFunction() &&

View File

@@ -138,9 +138,9 @@ lGetSystemISA() {
static const char *supportedCPUs[] = { static const char *supportedCPUs[] = {
"atom", "penryn", "core2", "corei7", "corei7-avx" "atom", "penryn", "core2", "corei7", "corei7-avx"
#if defined(LLVM_3_2) || defined(LLVM_3_3) #if !defined(LLVM_3_1)
, "core-avx-i", "core-avx2" , "core-avx-i", "core-avx2"
#endif // LLVM_3_2 or LLVM_3_3 #endif // LLVM 3.2+
}; };
Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) :

4
ispc.h
View File

@@ -40,8 +40,8 @@
#define ISPC_VERSION "1.3.1dev" #define ISPC_VERSION "1.3.1dev"
#if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) #if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4)
#error "Only LLVM 3.1, 3.2 and the 3.3 development branch are supported" #error "Only LLVM 3.1, 3.2, 3.3 and the 3.4 development branch are supported"
#endif #endif
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)

View File

@@ -68,6 +68,8 @@ lPrintVersion() {
"3.2" "3.2"
#elif defined(LLVM_3_3) #elif defined(LLVM_3_3)
"3.3" "3.3"
#elif defined(LLVM_3_4)
"3.4"
#else #else
#error "Unhandled LLVM version" #error "Unhandled LLVM version"
#endif #endif

View File

@@ -88,14 +88,12 @@
#include <llvm/Target/TargetOptions.h> #include <llvm/Target/TargetOptions.h>
#if defined(LLVM_3_1) #if defined(LLVM_3_1)
#include <llvm/Target/TargetData.h> #include <llvm/Target/TargetData.h>
#else #elif defined(LLVM_3_2)
#if defined(LLVM_3_2)
#include <llvm/DataLayout.h> #include <llvm/DataLayout.h>
#include <llvm/TargetTransformInfo.h> #include <llvm/TargetTransformInfo.h>
#else // LLVM 3.3+ #else // LLVM 3.3+
#include <llvm/IR/DataLayout.h> #include <llvm/IR/DataLayout.h>
#include <llvm/Analysis/TargetTransformInfo.h> #include <llvm/Analysis/TargetTransformInfo.h>
#endif
#endif #endif
#include <llvm/Analysis/Verifier.h> #include <llvm/Analysis/Verifier.h>
#include <llvm/Support/CFG.h> #include <llvm/Support/CFG.h>
@@ -768,14 +766,14 @@ Module::AddFunctionDeclaration(const std::string &name,
isInline) isInline)
#ifdef LLVM_3_2 #ifdef LLVM_3_2
function->addFnAttr(llvm::Attributes::AlwaysInline); function->addFnAttr(llvm::Attributes::AlwaysInline);
#else #else // LLVM 3.1 and 3.3+
function->addFnAttr(llvm::Attribute::AlwaysInline); function->addFnAttr(llvm::Attribute::AlwaysInline);
#endif #endif
if (functionType->isTask) if (functionType->isTask)
// This also applies transitively to members I think? // This also applies transitively to members I think?
#if defined(LLVM_3_1) #if defined(LLVM_3_1)
function->setDoesNotAlias(1, true); function->setDoesNotAlias(1, true);
#else #else // LLVM 3.2+
function->setDoesNotAlias(1); function->setDoesNotAlias(1);
#endif #endif
@@ -1817,7 +1815,7 @@ Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *ostre
// track the source file position by handling them ourselves. // track the source file position by handling them ourselves.
inst.getPreprocessorOutputOpts().ShowComments = 1; inst.getPreprocessorOutputOpts().ShowComments = 1;
#if defined(LLVM_3_3) #if !defined(LLVM_3_1) && !defined(LLVM_3_2) // LLVM 3.3+
inst.getPreprocessorOutputOpts().ShowCPP = 1; inst.getPreprocessorOutputOpts().ShowCPP = 1;
#endif #endif
@@ -1829,7 +1827,7 @@ Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *ostre
headerOpts.Verbose = 1; headerOpts.Verbose = 1;
for (int i = 0; i < (int)g->includePath.size(); ++i) { for (int i = 0; i < (int)g->includePath.size(); ++i) {
headerOpts.AddPath(g->includePath[i], clang::frontend::Angled, headerOpts.AddPath(g->includePath[i], clang::frontend::Angled,
#if !defined(LLVM_3_3) #if defined(LLVM_3_1) || defined(LLVM_3_2)
true /* is user supplied */, true /* is user supplied */,
#endif #endif
false /* not a framework */, false /* not a framework */,