aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-08 08:55:49 -0700
committerPirama Arumuga Nainar <pirama@google.com>2015-04-09 15:04:38 -0700
commit4c5e43da7792f75567b693105cc53e3f1992ad98 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /tools/bugpoint
parentc75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff)
downloadexternal_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.zip
external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.gz
external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.bz2
Update aosp/master llvm for rebase to r233350
Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/BugDriver.cpp26
-rw-r--r--tools/bugpoint/CMakeLists.txt2
-rw-r--r--tools/bugpoint/CrashDebugger.cpp1
-rw-r--r--tools/bugpoint/Miscompilation.cpp14
4 files changed, 24 insertions, 19 deletions
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index b8be17e..865cb51 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -16,6 +16,7 @@
#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Linker/Linker.h"
#include "llvm/Pass.h"
@@ -86,23 +87,28 @@ std::unique_ptr<Module> llvm::parseInputFile(StringRef Filename,
LLVMContext &Ctxt) {
SMDiagnostic Err;
std::unique_ptr<Module> Result = parseIRFile(Filename, Err, Ctxt);
- if (!Result)
+ if (!Result) {
Err.print("bugpoint", errs());
+ return Result;
+ }
+
+ if (verifyModule(*Result, &errs())) {
+ errs() << "bugpoint: " << Filename << ": error: does not verify\n";
+ return std::unique_ptr<Module>();
+ }
// If we don't have an override triple, use the first one to configure
// bugpoint, or use the host triple if none provided.
- if (Result) {
- if (TargetTriple.getTriple().empty()) {
- Triple TheTriple(Result->getTargetTriple());
+ if (TargetTriple.getTriple().empty()) {
+ Triple TheTriple(Result->getTargetTriple());
- if (TheTriple.getTriple().empty())
- TheTriple.setTriple(sys::getDefaultTargetTriple());
+ if (TheTriple.getTriple().empty())
+ TheTriple.setTriple(sys::getDefaultTargetTriple());
- TargetTriple.setTriple(TheTriple.getTriple());
- }
-
- Result->setTargetTriple(TargetTriple.getTriple()); // override the triple
+ TargetTriple.setTriple(TheTriple.getTriple());
}
+
+ Result->setTargetTriple(TargetTriple.getTriple()); // override the triple
return Result;
}
diff --git a/tools/bugpoint/CMakeLists.txt b/tools/bugpoint/CMakeLists.txt
index d71e097..daf502e 100644
--- a/tools/bugpoint/CMakeLists.txt
+++ b/tools/bugpoint/CMakeLists.txt
@@ -31,7 +31,7 @@ add_llvm_tool(bugpoint
ToolRunner.cpp
bugpoint.cpp
)
-set_target_properties(bugpoint PROPERTIES ENABLE_EXPORTS 1)
+export_executable_symbols(bugpoint)
if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS)
target_link_libraries(bugpoint Polly)
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index ee18169..f9f3f10 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -409,7 +409,6 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*>
// Verify that this is still valid.
legacy::PassManager Passes;
Passes.add(createVerifierPass());
- Passes.add(createDebugInfoVerifierPass());
Passes.run(*M);
// Try running on the hacked up program...
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 8cb4583..98061bd 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -975,7 +975,7 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe,
}
if (BD.writeProgramToFile(SafeModuleBC.str(), SafeModuleFD, Safe)) {
- errs() << "Error writing bitcode to `" << SafeModuleBC.str()
+ errs() << "Error writing bitcode to `" << SafeModuleBC
<< "'\nExiting.";
exit(1);
}
@@ -1050,7 +1050,7 @@ bool BugDriver::debugCodeGenerator(std::string *Error) {
}
if (writeProgramToFile(TestModuleBC.str(), TestModuleFD, ToCodeGen)) {
- errs() << "Error writing bitcode to `" << TestModuleBC.str()
+ errs() << "Error writing bitcode to `" << TestModuleBC
<< "'\nExiting.";
exit(1);
}
@@ -1068,7 +1068,7 @@ bool BugDriver::debugCodeGenerator(std::string *Error) {
}
if (writeProgramToFile(SafeModuleBC.str(), SafeModuleFD, ToNotCodeGen)) {
- errs() << "Error writing bitcode to `" << SafeModuleBC.str()
+ errs() << "Error writing bitcode to `" << SafeModuleBC
<< "'\nExiting.";
exit(1);
}
@@ -1079,17 +1079,17 @@ bool BugDriver::debugCodeGenerator(std::string *Error) {
outs() << "You can reproduce the problem with the command line: \n";
if (isExecutingJIT()) {
- outs() << " lli -load " << SharedObject << " " << TestModuleBC.str();
+ outs() << " lli -load " << SharedObject << " " << TestModuleBC;
} else {
- outs() << " llc " << TestModuleBC.str() << " -o " << TestModuleBC.str()
+ outs() << " llc " << TestModuleBC << " -o " << TestModuleBC
<< ".s\n";
outs() << " gcc " << SharedObject << " " << TestModuleBC.str()
- << ".s -o " << TestModuleBC.str() << ".exe";
+ << ".s -o " << TestModuleBC << ".exe";
#if defined (HAVE_LINK_R)
outs() << " -Wl,-R.";
#endif
outs() << "\n";
- outs() << " " << TestModuleBC.str() << ".exe";
+ outs() << " " << TestModuleBC << ".exe";
}
for (unsigned i = 0, e = InputArgv.size(); i != e; ++i)
outs() << " " << InputArgv[i];