summaryrefslogtreecommitdiff
path: root/tools/bugpoint/bugpoint.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-18 03:35:57 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-18 03:35:57 +0000
commitca7409664273fed4b473127295af3af0836b3077 (patch)
tree4dec85698109cbee1fa006a2cbcc962b0ec1628b /tools/bugpoint/bugpoint.cpp
parent2bd4bb0397135d2ccde8ff6f411da597d9e4ed55 (diff)
downloadllvm-ca7409664273fed4b473127295af3af0836b3077.tar.gz
llvm-ca7409664273fed4b473127295af3af0836b3077.tar.bz2
llvm-ca7409664273fed4b473127295af3af0836b3077.tar.xz
Change bugpoint to use Triple to make runtime decisions.
- This is cleaner, and makes bugpoint match the host instead of the build architecture. - Patch by Sandeep Patel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/bugpoint.cpp')
-rw-r--r--tools/bugpoint/bugpoint.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index d00036acd8..e527b2a149 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -66,6 +66,9 @@ static cl::opt<bool>
StandardLinkOpts("std-link-opts",
cl::desc("Include the standard link time optimizations"));
+static cl::opt<std::string>
+OverrideTriple("mtriple", cl::desc("Override target triple for module"));
+
/// BugpointIsInterrupted - Set to true when the user presses ctrl-c.
bool llvm::BugpointIsInterrupted = false;
@@ -98,9 +101,15 @@ int main(int argc, char **argv) {
sys::SetInterruptFunction(BugpointInterruptFunction);
LLVMContext& Context = getGlobalContext();
+ // If we have an override, set it and then track the triple we want Modules
+ // to use.
+ if (!OverrideTriple.empty())
+ TargetTriple.setTriple(OverrideTriple);
+ outs() << "override triple is " << OverrideTriple << '\n';
+
BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit, Context);
if (D.addSources(InputFilenames)) return 1;
-
+
AddToDriver PM(D);
if (StandardCompileOpts) {
createStandardModulePasses(&PM, 3,