Merge pull request #496 from dbabokin/llvm34

Enabling llvm 3.4
This commit is contained in:
Dmitry Babokin
2013-05-15 04:40:47 -07:00
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...
#if defined(LLVM_3_2)
func->addFnAttr(llvm::Attributes::AlwaysInline);
#else
#else // LLVM 3.1 and 3.3+
func->addFnAttr(llvm::Attribute::AlwaysInline);
#endif
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/FormattedStream.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#if defined(LLVM_3_3)
#include "llvm/InstVisitor.h"
#else
#if defined(LLVM_3_1) || defined(LLVM_3_2)
#include "llvm/Support/InstVisitor.h"
#else // LLVM 3.3+
#include "llvm/InstVisitor.h"
#endif
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TargetRegistry.h"

View File

@@ -3293,7 +3293,7 @@ FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType,
// alias analysis.
// TODO: what other attributes needs to be copied?
// 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);
if (cc &&
cc->getCalledFunction() &&

View File

@@ -138,9 +138,9 @@ lGetSystemISA() {
static const char *supportedCPUs[] = {
"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"
#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) :

4
ispc.h
View File

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

View File

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

View File

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