Fix build with LLVM ToT
This commit is contained in:
4
ispc.cpp
4
ispc.cpp
@@ -211,7 +211,11 @@ std::string
|
|||||||
Target::GetTripleString() const {
|
Target::GetTripleString() const {
|
||||||
llvm::Triple triple;
|
llvm::Triple triple;
|
||||||
// Start with the host triple as the default
|
// Start with the host triple as the default
|
||||||
|
#if defined(LLVM_3_1) || defined(LLVM_3_1svn)
|
||||||
|
triple.setTriple(llvm::sys::getDefaultTargetTriple());
|
||||||
|
#else
|
||||||
triple.setTriple(llvm::sys::getHostTriple());
|
triple.setTriple(llvm::sys::getHostTriple());
|
||||||
|
#endif
|
||||||
|
|
||||||
// And override the arch in the host triple based on what the user
|
// And override the arch in the host triple based on what the user
|
||||||
// specified. Here we need to deal with the fact that LLVM uses one
|
// specified. Here we need to deal with the fact that LLVM uses one
|
||||||
|
|||||||
@@ -1114,8 +1114,13 @@ Module::execPreprocessor(const char* infilename, llvm::raw_string_ostream* ostre
|
|||||||
|
|
||||||
clang::TargetOptions &options = inst.getTargetOpts();
|
clang::TargetOptions &options = inst.getTargetOpts();
|
||||||
llvm::Triple triple(module->getTargetTriple());
|
llvm::Triple triple(module->getTargetTriple());
|
||||||
if (triple.getTriple().empty())
|
if (triple.getTriple().empty()) {
|
||||||
|
#if defined(LLVM_3_1) || defined(LLVM_3_1svn)
|
||||||
|
triple.setTriple(llvm::sys::getDefaultTargetTriple());
|
||||||
|
#else
|
||||||
triple.setTriple(llvm::sys::getHostTriple());
|
triple.setTriple(llvm::sys::getHostTriple());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
options.Triple = triple.getTriple();
|
options.Triple = triple.getTriple();
|
||||||
|
|
||||||
clang::TargetInfo *target =
|
clang::TargetInfo *target =
|
||||||
|
|||||||
Reference in New Issue
Block a user