summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-11-18 14:58:34 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-11-18 14:58:34 +0000
commitd2e985fd323c167e20f77b045a1d99ad166e65db (patch)
tree6a111e552c75afc66228e3d8f19b6731e4013f10 /tools
parentded64d5d348ce8d8c5aa42cf63f6de9dd84b7e89 (diff)
downloadFreeBSD-src-d2e985fd323c167e20f77b045a1d99ad166e65db.zip
FreeBSD-src-d2e985fd323c167e20f77b045a1d99ad166e65db.tar.gz
Update LLVM to r89205.
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/ToolRunner.cpp15
-rw-r--r--tools/llvm-config/CMakeLists.txt3
-rw-r--r--tools/lto/LTOCodeGenerator.cpp50
3 files changed, 16 insertions, 52 deletions
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 <fstream>
#include <sstream>
@@ -200,14 +199,15 @@ int LLI::ExecuteProgram(const std::string &Bitcode,
const std::vector<std::string> &SharedLibs,
unsigned Timeout,
unsigned MemoryLimit) {
- if (!SharedLibs.empty())
- throw ToolExecutionError("LLI currently does not support "
- "loading shared libraries.");
-
std::vector<const char*> LLIArgs;
LLIArgs.push_back(LLIPath.c_str());
LLIArgs.push_back("-force-interpreter=true");
+ for (std::vector<std::string>::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<std::string> Args)
{
for (std::vector<std::string>::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<const char*> 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) )
OpenPOWER on IntegriCloud