mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
[PM] Push the debug option for the new pass manager into the opt tool
and expose the necessary hooks in the API directly. This makes it much cleaner for example to log the usage of a pass manager from a library. It also makes it more obvious that this functionality isn't "optional" or "asserts-only" for the pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,12 +30,16 @@
|
||||
using namespace llvm;
|
||||
using namespace opt_tool;
|
||||
|
||||
static cl::opt<bool>
|
||||
DebugPM("debug-pass-manager", cl::Hidden,
|
||||
cl::desc("Print pass management debugging information"));
|
||||
|
||||
bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
|
||||
tool_output_file *Out, StringRef PassPipeline,
|
||||
OutputKind OK, VerifierKind VK) {
|
||||
FunctionAnalysisManager FAM;
|
||||
CGSCCAnalysisManager CGAM;
|
||||
ModuleAnalysisManager MAM;
|
||||
FunctionAnalysisManager FAM(DebugPM);
|
||||
CGSCCAnalysisManager CGAM(DebugPM);
|
||||
ModuleAnalysisManager MAM(DebugPM);
|
||||
|
||||
// Register all the basic analyses with the managers.
|
||||
registerModuleAnalyses(MAM);
|
||||
@@ -50,11 +54,11 @@ bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
|
||||
FAM.registerPass(CGSCCAnalysisManagerFunctionProxy(CGAM));
|
||||
FAM.registerPass(ModuleAnalysisManagerFunctionProxy(MAM));
|
||||
|
||||
ModulePassManager MPM;
|
||||
ModulePassManager MPM(DebugPM);
|
||||
if (VK > VK_NoVerifier)
|
||||
MPM.addPass(VerifierPass());
|
||||
|
||||
if (!parsePassPipeline(MPM, PassPipeline, VK == VK_VerifyEachPass)) {
|
||||
if (!parsePassPipeline(MPM, PassPipeline, VK == VK_VerifyEachPass, DebugPM)) {
|
||||
errs() << Arg0 << ": unable to parse pass pipeline description.\n";
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user