summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-05-09 17:43:30 +0000
committerAdrian Prantl <aprantl@apple.com>2016-05-09 17:43:30 +0000
commit6d80100c6a6cf491ffe32138a015975901fcc3e0 (patch)
tree4ee4c1a96edbb66aa8b5e20ae5e5af09e865da70 /llvm/lib
parent614d411a0d0078cc20d55b20b37a32a8c0c52400 (diff)
downloadbcm5719-llvm-6d80100c6a6cf491ffe32138a015975901fcc3e0.tar.gz
bcm5719-llvm-6d80100c6a6cf491ffe32138a015975901fcc3e0.zip
Revert "Allow the LTO code generator to strip invalid debug info from the input."
This reverts commit 268936 while investigating buildbot breakage. llvm-svn: 268940
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Verifier.cpp10
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp20
2 files changed, 3 insertions, 27 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index e09f763f10b..576aefdf29a 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4417,22 +4417,18 @@ bool llvm::verifyFunction(const Function &f, raw_ostream *OS) {
return !V.verify(F);
}
-bool llvm::verifyModule(const Module &M, raw_ostream *OS,
- bool *BrokenDebugInfo) {
+bool llvm::verifyModule(const Module &M, raw_ostream *OS) {
// Don't use a raw_null_ostream. Printing IR is expensive.
- Verifier V(OS, /*ShouldTreatBrokenDebugInfoAsError=*/!BrokenDebugInfo);
+ Verifier V(OS, /*ShouldTreatBrokenDebugInfoAsError=*/true);
bool Broken = false;
for (const Function &F : M)
if (!F.isDeclaration() && !F.isMaterializable())
Broken |= !V.verify(F);
- Broken |= !V.verify(M);
- if (BrokenDebugInfo)
- *BrokenDebugInfo = V.hasBrokenDebugInfo();
// Note that this function's return value is inverted from what you would
// expect of a function called "verify".
- return Broken;
+ return !V.verify(M) || Broken;
}
namespace {
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 0e1c46cff27..226004a3353 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -26,7 +26,6 @@
#include "llvm/Config/config.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
@@ -79,16 +78,6 @@ cl::opt<bool> LTODiscardValueNames(
cl::init(false),
#endif
cl::Hidden);
-
-cl::opt<bool> LTOStripInvalidDebugInfo(
- "lto-strip-invalid-debug-info",
- cl::desc("Strip invalid debug info metadata during LTO instead of aborting."),
-#ifdef NDEBUG
- cl::init(true),
-#else
- cl::init(false),
-#endif
- cl::Hidden);
}
LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
@@ -499,15 +488,6 @@ void LTOCodeGenerator::verifyMergedModuleOnce() {
return;
HasVerifiedInput = true;
- if (LTOStripInvalidDebugInfo) {
- bool BrokenDebugInfo = false;
- if (verifyModule(*MergedModule, &dbgs(), &BrokenDebugInfo))
- report_fatal_error("Broken module found, compilation aborted!");
- if (BrokenDebugInfo) {
- emitWarning("Invalid debug info found, debug info will be stripped");
- StripDebugInfo(*MergedModule);
- }
- }
if (verifyModule(*MergedModule, &dbgs()))
report_fatal_error("Broken module found, compilation aborted!");
}
OpenPOWER on IntegriCloud