--- /dev/null
+; RUN: opt -passes=inline < %s -debug-pass-manager 2>&1 | FileCheck %s --check-prefix=NORMAL
+; RUN: opt -passes=inline < %s -debug-pass-manager=quiet 2>&1 | FileCheck %s --check-prefix=QUIET
+; RUN: opt -passes=inline < %s -debug-pass-manager=verbose 2>&1 | FileCheck %s --check-prefix=VERBOSE
+
+define void @a() {
+ ret void
+}
+
+; QUIET-NOT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; QUIET: Running pass: InlinerPass
+; QUIET-NOT: Running analysis
+
+; NORMAL-NOT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; NORMAL: Running pass: InlinerPass
+; NORMAL: Running analysis
+
+; VERBOSE: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; VERBOSE: Running pass: InlinerPass
+; VERBOSE: Running analysis
cl::value_desc("filename"));
} // namespace llvm
-enum class DebugLogging { None, Normal, Verbose };
+enum class DebugLogging { None, Normal, Verbose, Quiet };
static cl::opt<DebugLogging> DebugPM(
"debug-pass-manager", cl::Hidden, cl::ValueOptional,
cl::init(DebugLogging::None),
cl::values(
clEnumValN(DebugLogging::Normal, "", ""),
+ clEnumValN(DebugLogging::Quiet, "quiet",
+ "Skip printing info about analyses"),
clEnumValN(
DebugLogging::Verbose, "verbose",
"Print extra information about adaptors and pass managers")));
PassInstrumentationCallbacks PIC;
PrintPassOptions PrintPassOpts;
PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;
+ PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;
StandardInstrumentations SI(DebugPM != DebugLogging::None, VerifyEachPass,
PrintPassOpts);
SI.registerCallbacks(PIC, &FAM);