summaryrefslogtreecommitdiff
path: root/tools/bugpoint/Miscompilation.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/Miscompilation.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/Miscompilation.cpp')
-rw-r--r--tools/bugpoint/Miscompilation.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 64dfe8853e..9c14147295 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -14,6 +14,7 @@
#include "BugDriver.h"
#include "ListReducer.h"
+#include "ToolRunner.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
@@ -937,13 +938,13 @@ bool BugDriver::debugCodeGenerator() {
outs() << '\n';
outs() << "The shared object was created with:\n llc -march=c "
<< SafeModuleBC << " -o temporary.c\n"
- << " gcc -xc temporary.c -O2 -o " << SharedObject
-#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
- << " -G" // Compile a shared library, `-G' for Sparc
-#else
- << " -fPIC -shared" // `-shared' for Linux/X86, maybe others
-#endif
- << " -fno-strict-aliasing\n";
+ << " gcc -xc temporary.c -O2 -o " << SharedObject;
+ if (TargetTriple.getArch() == Triple::sparc)
+ outs() << " -G"; // Compile a shared library, `-G' for Sparc
+ else
+ outs() << " -fPIC -shared"; // `-shared' for Linux/X86, maybe others
+
+ outs() << " -fno-strict-aliasing\n";
return false;
}