Update build to handle existence of LLVM 3.2 dev branch.

We now compile with LLVM 3.0, 3.1, and 3.2svn.
This commit is contained in:
Matt Pharr
2012-05-03 08:25:25 -07:00
parent c4b1d79c5c
commit ee1fe3aa9f
9 changed files with 85 additions and 135 deletions

View File

@@ -271,11 +271,6 @@ extern void yy_delete_buffer(YY_BUFFER_STATE);
int
Module::CompileFile() {
#ifndef LLVM_3_1svn
if (g->opt.fastMath == true)
llvm::UnsafeFPMath = true;
#endif // !LLVM_3_1svn
extern void ParserInit();
ParserInit();
@@ -1286,10 +1281,10 @@ 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 defined(LLVM_3_1) || defined(LLVM_3_1svn)
triple.setTriple(llvm::sys::getDefaultTargetTriple());
#else
#ifdef LLVM_3_0
triple.setTriple(llvm::sys::getHostTriple());
#else
triple.setTriple(llvm::sys::getDefaultTargetTriple());
#endif
}
options.Triple = triple.getTriple();