8
Makefile
8
Makefile
@@ -56,7 +56,7 @@ endif
|
|||||||
ARCH_TYPE = $(shell arch)
|
ARCH_TYPE = $(shell arch)
|
||||||
|
|
||||||
LLVM_CXXFLAGS=$(shell $(LLVM_CONFIG) --cppflags)
|
LLVM_CXXFLAGS=$(shell $(LLVM_CONFIG) --cppflags)
|
||||||
LLVM_VERSION=LLVM_$(shell $(LLVM_CONFIG) --version | sed -e s/\\./_/ -e s/svn//)
|
LLVM_VERSION=LLVM_$(shell $(LLVM_CONFIG) --version | sed -e s/\\./_/ -e s/svn// -e s/\.0//)
|
||||||
LLVM_VERSION_DEF=-D$(LLVM_VERSION)
|
LLVM_VERSION_DEF=-D$(LLVM_VERSION)
|
||||||
|
|
||||||
LLVM_COMPONENTS = engine ipo bitreader bitwriter instrumentation linker
|
LLVM_COMPONENTS = engine ipo bitreader bitwriter instrumentation linker
|
||||||
@@ -119,9 +119,9 @@ CXXFLAGS=$(OPT) $(LLVM_CXXFLAGS) -I. -Iobjs/ -I$(CLANG_INCLUDE) \
|
|||||||
$(LLVM_VERSION_DEF) \
|
$(LLVM_VERSION_DEF) \
|
||||||
-Wall \
|
-Wall \
|
||||||
-DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\"" \
|
-DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\"" \
|
||||||
-Wno-sign-compare -Wno-unused-function
|
-Wno-sign-compare -Wno-unused-function -Werror
|
||||||
ifneq ($(LLVM_VERSION),LLVM_3_1)
|
ifeq ($(LLVM_VERSION),LLVM_3_5)
|
||||||
CXXFLAGS+=-Werror
|
CXXFLAGS+=-std=c++11 -Wno-c99-extensions -Wno-deprecated-register
|
||||||
endif
|
endif
|
||||||
ifneq ($(ARM_ENABLED), 0)
|
ifneq ($(ARM_ENABLED), 0)
|
||||||
CXXFLAGS+=-DISPC_ARM_ENABLED
|
CXXFLAGS+=-DISPC_ARM_ENABLED
|
||||||
|
|||||||
14
cbackend.cpp
14
cbackend.cpp
@@ -1462,7 +1462,7 @@ void CWriter::printConstant(llvm::Constant *CPV, bool Static) {
|
|||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
|
|
||||||
uint64_t ll = llvm::DoubleToBits(V);
|
uint64_t ll = llvm::DoubleToBits(V);
|
||||||
sprintf(Buffer, "0x%"PRIx64, ll);
|
sprintf(Buffer, "0x%" PRIx64, ll);
|
||||||
|
|
||||||
std::string Num(&Buffer[0], &Buffer[6]);
|
std::string Num(&Buffer[0], &Buffer[6]);
|
||||||
unsigned long Val = strtoul(Num.c_str(), 0, 16);
|
unsigned long Val = strtoul(Num.c_str(), 0, 16);
|
||||||
@@ -3123,7 +3123,11 @@ void CWriter::visitSwitchInst(llvm::SwitchInst &SI) {
|
|||||||
Out << ":\n";
|
Out << ":\n";
|
||||||
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
||||||
printBranchToBlock(SI.getParent(), Succ, 2);
|
printBranchToBlock(SI.getParent(), Succ, 2);
|
||||||
|
#if defined (LLVM_3_5)
|
||||||
|
if (llvm::Function::iterator(Succ) == std::next(llvm::Function::iterator(SI.getParent())))
|
||||||
|
#else
|
||||||
if (llvm::Function::iterator(Succ) == llvm::next(llvm::Function::iterator(SI.getParent())))
|
if (llvm::Function::iterator(Succ) == llvm::next(llvm::Function::iterator(SI.getParent())))
|
||||||
|
#endif
|
||||||
Out << " break;\n";
|
Out << " break;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3144,7 +3148,11 @@ bool CWriter::isGotoCodeNecessary(llvm::BasicBlock *From, llvm::BasicBlock *To)
|
|||||||
/// FIXME: This should be reenabled, but loop reordering safe!!
|
/// FIXME: This should be reenabled, but loop reordering safe!!
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
#if defined (LLVM_3_5)
|
||||||
|
if (std::next(llvm::Function::iterator(From)) != llvm::Function::iterator(To))
|
||||||
|
#else
|
||||||
if (llvm::next(llvm::Function::iterator(From)) != llvm::Function::iterator(To))
|
if (llvm::next(llvm::Function::iterator(From)) != llvm::Function::iterator(To))
|
||||||
|
#endif
|
||||||
return true; // Not the direct successor, we need a goto.
|
return true; // Not the direct successor, we need a goto.
|
||||||
|
|
||||||
//llvm::isa<llvm::SwitchInst>(From->getTerminator())
|
//llvm::isa<llvm::SwitchInst>(From->getTerminator())
|
||||||
@@ -3752,7 +3760,11 @@ void CWriter::lowerIntrinsics(llvm::Function &F) {
|
|||||||
// All other intrinsic calls we must lower.
|
// All other intrinsic calls we must lower.
|
||||||
llvm::Instruction *Before = 0;
|
llvm::Instruction *Before = 0;
|
||||||
if (CI != &BB->front())
|
if (CI != &BB->front())
|
||||||
|
#if defined(LLVM_3_5)
|
||||||
|
Before = std::prev(llvm::BasicBlock::iterator(CI));
|
||||||
|
#else
|
||||||
Before = prior(llvm::BasicBlock::iterator(CI));
|
Before = prior(llvm::BasicBlock::iterator(CI));
|
||||||
|
#endif
|
||||||
|
|
||||||
IL->LowerIntrinsicCall(CI);
|
IL->LowerIntrinsicCall(CI);
|
||||||
if (Before) { // Move iterator to instruction after call
|
if (Before) { // Move iterator to instruction after call
|
||||||
|
|||||||
7
ctx.cpp
7
ctx.cpp
@@ -1546,7 +1546,14 @@ FunctionEmitContext::StartScope() {
|
|||||||
llvm::DILexicalBlock lexicalBlock =
|
llvm::DILexicalBlock lexicalBlock =
|
||||||
m->diBuilder->createLexicalBlock(parentScope, diFile,
|
m->diBuilder->createLexicalBlock(parentScope, diFile,
|
||||||
currentPos.first_line,
|
currentPos.first_line,
|
||||||
|
#if defined(LLVM_3_5)
|
||||||
|
// Revision 202736 in LLVM adds support of DWARF discriminator
|
||||||
|
// to the last argument and revision 202737 in clang adds 0
|
||||||
|
// for the last argument by default.
|
||||||
|
currentPos.first_column, 0);
|
||||||
|
#else
|
||||||
currentPos.first_column);
|
currentPos.first_column);
|
||||||
|
#endif
|
||||||
AssertPos(currentPos, lexicalBlock.Verify());
|
AssertPos(currentPos, lexicalBlock.Verify());
|
||||||
debugScopes.push_back(lexicalBlock);
|
debugScopes.push_back(lexicalBlock);
|
||||||
}
|
}
|
||||||
|
|||||||
4
expr.cpp
4
expr.cpp
@@ -6194,10 +6194,10 @@ ConstExpr::Print() const {
|
|||||||
printf("%f", floatVal[i]);
|
printf("%f", floatVal[i]);
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_INT64:
|
case AtomicType::TYPE_INT64:
|
||||||
printf("%"PRId64, int64Val[i]);
|
printf("%" PRId64, int64Val[i]);
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_UINT64:
|
case AtomicType::TYPE_UINT64:
|
||||||
printf("%"PRIu64, uint64Val[i]);
|
printf("%" PRIu64, uint64Val[i]);
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_DOUBLE:
|
case AtomicType::TYPE_DOUBLE:
|
||||||
printf("%f", doubleVal[i]);
|
printf("%f", doubleVal[i]);
|
||||||
|
|||||||
2
util.cpp
2
util.cpp
@@ -577,7 +577,7 @@ GetDirectoryAndFileName(const std::string ¤tDirectory,
|
|||||||
const char *basenameStart = strrchr(fp, '/');
|
const char *basenameStart = strrchr(fp, '/');
|
||||||
Assert(basenameStart != NULL);
|
Assert(basenameStart != NULL);
|
||||||
++basenameStart;
|
++basenameStart;
|
||||||
Assert(basenameStart != '\0');
|
Assert(basenameStart[0] != '\0');
|
||||||
*filename = basenameStart;
|
*filename = basenameStart;
|
||||||
*directory = std::string(fp, basenameStart - fp);
|
*directory = std::string(fp, basenameStart - fp);
|
||||||
#endif // ISPC_IS_WINDOWS
|
#endif // ISPC_IS_WINDOWS
|
||||||
|
|||||||
Reference in New Issue
Block a user