summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/Passes.cpp10
-rw-r--r--llvm/lib/IR/Verifier.cpp34
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp1
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp8
-rw-r--r--llvm/lib/Transforms/Scalar/Scalar.cpp1
5 files changed, 5 insertions, 49 deletions
diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp
index 1184525a288..b904b109952 100644
--- a/llvm/lib/CodeGen/Passes.cpp
+++ b/llvm/lib/CodeGen/Passes.cpp
@@ -374,10 +374,8 @@ void TargetPassConfig::addIRPasses() {
// Before running any passes, run the verifier to determine if the input
// coming from the front-end and/or optimizer is valid.
- if (!DisableVerify) {
+ if (!DisableVerify)
addPass(createVerifierPass());
- addPass(createDebugInfoVerifierPass());
- }
// Run loop strength reduction before anything else.
if (getOptLevel() != CodeGenOpt::None && !DisableLSR) {
@@ -448,12 +446,6 @@ void TargetPassConfig::addCodeGenPrepare() {
void TargetPassConfig::addISelPrepare() {
addPreISel();
- // Need to verify DebugInfo *before* creating the stack protector analysis.
- // It's a function pass, and verifying between it and its users causes a
- // crash.
- if (!DisableVerify)
- addPass(createDebugInfoVerifierPass());
-
addPass(createStackProtectorPass(TM));
if (PrintISelInput)
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 219a7aa16a4..34e61dbff3e 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3147,30 +3147,8 @@ struct VerifierLegacyPass : public FunctionPass {
if (!V.verify(M) && FatalErrors)
report_fatal_error("Broken module found, compilation aborted!");
- return false;
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- }
-};
-struct DebugInfoVerifierLegacyPass : public ModulePass {
- static char ID;
-
- DebugInfoVerifier V;
- bool FatalErrors;
-
- DebugInfoVerifierLegacyPass() : ModulePass(ID), FatalErrors(true) {
- initializeDebugInfoVerifierLegacyPassPass(*PassRegistry::getPassRegistry());
- }
- explicit DebugInfoVerifierLegacyPass(bool FatalErrors)
- : ModulePass(ID), V(dbgs()), FatalErrors(FatalErrors) {
- initializeDebugInfoVerifierLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnModule(Module &M) override {
- if (!V.verify(M) && FatalErrors)
- report_fatal_error("Broken debug info found, compilation aborted!");
+ if (!DebugInfoVerifier(dbgs()).verify(M) && FatalErrors)
+ report_fatal_error("Broken module found, compilation aborted!");
return false;
}
@@ -3184,18 +3162,10 @@ struct DebugInfoVerifierLegacyPass : public ModulePass {
char VerifierLegacyPass::ID = 0;
INITIALIZE_PASS(VerifierLegacyPass, "verify", "Module Verifier", false, false)
-char DebugInfoVerifierLegacyPass::ID = 0;
-INITIALIZE_PASS(DebugInfoVerifierLegacyPass, "verify-di", "Debug Info Verifier",
- false, false)
-
FunctionPass *llvm::createVerifierPass(bool FatalErrors) {
return new VerifierLegacyPass(FatalErrors);
}
-ModulePass *llvm::createDebugInfoVerifierPass(bool FatalErrors) {
- return new DebugInfoVerifierLegacyPass(FatalErrors);
-}
-
PreservedAnalyses VerifierPass::run(Module &M) {
if (verifyModule(M, &dbgs()) && FatalErrors)
report_fatal_error("Broken module found, compilation aborted!");
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 797c64941ef..a6f980b77ba 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -471,7 +471,6 @@ void LTOCodeGenerator::applyScopeRestrictions() {
// Start off with a verification pass.
legacy::PassManager passes;
passes.add(createVerifierPass());
- passes.add(createDebugInfoVerifierPass());
// mark which symbols can not be internalized
Mangler Mangler(TargetMach->getDataLayout());
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 46e221037ca..d28d5630fbd 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -511,10 +511,8 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
if (LibraryInfo)
PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
- if (VerifyInput) {
+ if (VerifyInput)
PM.add(createVerifierPass());
- PM.add(createDebugInfoVerifierPass());
- }
if (OptLevel > 1)
addLTOOptimizationPasses(PM);
@@ -527,10 +525,8 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
if (OptLevel != 0)
addLateLTOOptimizationPasses(PM);
- if (VerifyOutput) {
+ if (VerifyOutput)
PM.add(createVerifierPass());
- PM.add(createDebugInfoVerifierPass());
- }
}
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 02baab4446c..6cc8411bb5b 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -210,7 +210,6 @@ void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
void LLVMAddVerifierPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createVerifierPass());
- // FIXME: should this also add createDebugInfoVerifierPass()?
}
void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM) {
OpenPOWER on IntegriCloud