Fix build with LLVM ToT

This commit is contained in:
Matt Pharr
2011-11-04 07:06:15 -07:00
parent ba9bb3338f
commit 5fc8df3e55
2 changed files with 10 additions and 1 deletions

View File

@@ -1114,8 +1114,13 @@ Module::execPreprocessor(const char* infilename, llvm::raw_string_ostream* ostre
clang::TargetOptions &options = inst.getTargetOpts();
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());
#endif
}
options.Triple = triple.getTriple();
clang::TargetInfo *target =