[llvm] r225144 - [PM] Wire up support for explicitly running the verifier pass.

Chandler Carruth chandlerc at gmail.com
Sun Jan 4 16:08:53 PST 2015


Author: chandlerc
Date: Sun Jan  4 18:08:53 2015
New Revision: 225144

URL: http://llvm.org/viewvc/llvm-project?rev=225144&view=rev
Log:
[PM] Wire up support for explicitly running the verifier pass.

The required functionality has been there for some time, but I never
managed to actually wire it into the command line registry of passes.
Let's do that.

Modified:
    llvm/trunk/test/Other/new-pass-manager.ll
    llvm/trunk/tools/opt/PassRegistry.def

Modified: llvm/trunk/test/Other/new-pass-manager.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/new-pass-manager.ll?rev=225144&r1=225143&r2=225144&view=diff
==============================================================================
--- llvm/trunk/test/Other/new-pass-manager.ll (original)
+++ llvm/trunk/test/Other/new-pass-manager.ll Sun Jan  4 18:08:53 2015
@@ -15,6 +15,15 @@
 ; CHECK-MODULE-PRINT: Running module pass: VerifierPass
 ; CHECK-MODULE-PRINT: Finished module pass manager
 
+; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='print,verify' %s 2>&1 \
+; RUN:     | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY
+; CHECK-MODULE-VERIFY: Starting module pass manager
+; CHECK-MODULE-VERIFY: Running module pass: PrintModulePass
+; CHECK-MODULE-VERIFY: ModuleID
+; CHECK-MODULE-VERIFY: define void @foo()
+; CHECK-MODULE-VERIFY: Running module pass: VerifierPass
+; CHECK-MODULE-VERIFY: Finished module pass manager
+
 ; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
 ; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
 ; CHECK-FUNCTION-PRINT: Starting module pass manager
@@ -27,6 +36,17 @@
 ; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass
 ; CHECK-FUNCTION-PRINT: Finished module pass manager
 
+; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \
+; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
+; CHECK-FUNCTION-VERIFY: Starting module pass manager
+; CHECK-FUNCTION-VERIFY: Starting function pass manager
+; CHECK-FUNCTION-VERIFY: Running function pass: PrintFunctionPass
+; CHECK-FUNCTION-VERIFY-NOT: ModuleID
+; CHECK-FUNCTION-VERIFY: define void @foo()
+; CHECK-FUNCTION-VERIFY: Running function pass: VerifierPass
+; CHECK-FUNCTION-VERIFY: Finished function pass manager
+; CHECK-FUNCTION-VERIFY: Finished module pass manager
+
 ; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
 ; RUN:     | FileCheck %s --check-prefix=CHECK-NOOP
 ; CHECK-NOOP: define void @foo() {

Modified: llvm/trunk/tools/opt/PassRegistry.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PassRegistry.def?rev=225144&r1=225143&r2=225144&view=diff
==============================================================================
--- llvm/trunk/tools/opt/PassRegistry.def (original)
+++ llvm/trunk/tools/opt/PassRegistry.def Sun Jan  4 18:08:53 2015
@@ -27,6 +27,7 @@ MODULE_ANALYSIS("lcg", LazyCallGraphAnal
 #endif
 MODULE_PASS("print", PrintModulePass(dbgs()))
 MODULE_PASS("print-cg", LazyCallGraphPrinterPass(dbgs()))
+MODULE_PASS("verify", VerifierPass())
 #undef MODULE_PASS
 
 #ifndef CGSCC_ANALYSIS
@@ -48,4 +49,5 @@ MODULE_PASS("print-cg", LazyCallGraphPri
 #define FUNCTION_PASS(NAME, CREATE_PASS)
 #endif
 FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
+FUNCTION_PASS("verify", VerifierPass())
 #undef FUNCTION_PASS





More information about the llvm-commits mailing list