From d2e985fd323c167e20f77b045a1d99ad166e65db Mon Sep 17 00:00:00 2001 From: rdivacky Date: Wed, 18 Nov 2009 14:58:34 +0000 Subject: Update LLVM to r89205. --- tools/bugpoint/ToolRunner.cpp | 15 ++++++------ tools/llvm-config/CMakeLists.txt | 3 --- tools/lto/LTOCodeGenerator.cpp | 50 +++++++--------------------------------- 3 files changed, 16 insertions(+), 52 deletions(-) (limited to 'tools') diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 4551d41..645776e 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" // for HAVE_LINK_R #include #include @@ -200,14 +199,15 @@ int LLI::ExecuteProgram(const std::string &Bitcode, const std::vector &SharedLibs, unsigned Timeout, unsigned MemoryLimit) { - if (!SharedLibs.empty()) - throw ToolExecutionError("LLI currently does not support " - "loading shared libraries."); - std::vector LLIArgs; LLIArgs.push_back(LLIPath.c_str()); LLIArgs.push_back("-force-interpreter=true"); + for (std::vector::const_iterator i = SharedLibs.begin(), e = SharedLibs.end(); i != e; ++i) { + LLIArgs.push_back("-load"); + LLIArgs.push_back((*i).c_str()); + } + // Add any extra LLI args. for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i) LLIArgs.push_back(ToolArgs[i].c_str()); @@ -610,9 +610,10 @@ IsARMArchitecture(std::vector Args) { for (std::vector::const_iterator I = Args.begin(), E = Args.end(); I != E; ++I) { - if (!StringsEqualNoCase(*I, "-arch")) { + StringRef S(*I); + if (!S.equals_lower("-arch")) { ++I; - if ((I != E) && !StringsEqualNoCase(I->c_str(), "arm", strlen("arm"))) { + if (I != E && !S.substr(0, strlen("arm")).equals_lower("arm")) { return true; } } diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index 7638f3c..8a710ea 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -36,9 +36,6 @@ foreach(l ${LLVM_SYSTEM_LIBS_LIST}) set(LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS} "-l${l}") endforeach() -include(GetTargetTriple) -get_target_triple(target) - foreach(c ${LLVM_TARGETS_TO_BUILD}) set(TARGETS_BUILT "${TARGETS_BUILT} ${c}") endforeach(c) diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index c621721..eb82f98 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -24,6 +24,7 @@ #include "llvm/ModuleProvider.h" #include "llvm/PassManager.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/Triple.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/Verifier.h" @@ -242,51 +243,16 @@ bool LTOCodeGenerator::assemble(const std::string& asmPath, // build argument list std::vector args; - std::string targetTriple = _linker.getModule()->getTargetTriple(); + llvm::Triple targetTriple(_linker.getModule()->getTargetTriple()); + const char *arch = targetTriple.getArchNameForAssembler(); + args.push_back(tool.c_str()); - if ( targetTriple.find("darwin") != std::string::npos ) { + + if (targetTriple.getOS() == Triple::Darwin) { // darwin specific command line options - if (strncmp(targetTriple.c_str(), "i386-apple-", 11) == 0) { - args.push_back("-arch"); - args.push_back("i386"); - } - else if (strncmp(targetTriple.c_str(), "x86_64-apple-", 13) == 0) { - args.push_back("-arch"); - args.push_back("x86_64"); - } - else if (strncmp(targetTriple.c_str(), "powerpc-apple-", 14) == 0) { - args.push_back("-arch"); - args.push_back("ppc"); - } - else if (strncmp(targetTriple.c_str(), "powerpc64-apple-", 16) == 0) { - args.push_back("-arch"); - args.push_back("ppc64"); - } - else if (strncmp(targetTriple.c_str(), "arm-apple-", 10) == 0) { - args.push_back("-arch"); - args.push_back("arm"); - } - else if ((strncmp(targetTriple.c_str(), "armv4t-apple-", 13) == 0) || - (strncmp(targetTriple.c_str(), "thumbv4t-apple-", 15) == 0)) { - args.push_back("-arch"); - args.push_back("armv4t"); - } - else if ((strncmp(targetTriple.c_str(), "armv5-apple-", 12) == 0) || - (strncmp(targetTriple.c_str(), "armv5e-apple-", 13) == 0) || - (strncmp(targetTriple.c_str(), "thumbv5-apple-", 14) == 0) || - (strncmp(targetTriple.c_str(), "thumbv5e-apple-", 15) == 0)) { - args.push_back("-arch"); - args.push_back("armv5"); - } - else if ((strncmp(targetTriple.c_str(), "armv6-apple-", 12) == 0) || - (strncmp(targetTriple.c_str(), "thumbv6-apple-", 14) == 0)) { - args.push_back("-arch"); - args.push_back("armv6"); - } - else if ((strncmp(targetTriple.c_str(), "armv7-apple-", 12) == 0) || - (strncmp(targetTriple.c_str(), "thumbv7-apple-", 14) == 0)) { + if (arch != NULL) { args.push_back("-arch"); - args.push_back("armv7"); + args.push_back(arch); } // add -static to assembler command line when code model requires if ( (_assemblerPath != NULL) && (_codeModel == LTO_CODEGEN_PIC_MODEL_STATIC) ) -- cgit v1.1