mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
[PM] Refactor the analysis registration and pass pipeline parsing to
live in a class. While this isn't really significant right now, I need to expose some state to the pass construction expressions, and making them get evaluated within a class context is a nice way to collect members that they may need to access. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227715 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -38,14 +38,16 @@ static cl::opt<bool>
|
||||
bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
|
||||
tool_output_file *Out, StringRef PassPipeline,
|
||||
OutputKind OK, VerifierKind VK) {
|
||||
Passes P;
|
||||
|
||||
FunctionAnalysisManager FAM(DebugPM);
|
||||
CGSCCAnalysisManager CGAM(DebugPM);
|
||||
ModuleAnalysisManager MAM(DebugPM);
|
||||
|
||||
// Register all the basic analyses with the managers.
|
||||
registerModuleAnalyses(MAM);
|
||||
registerCGSCCAnalyses(CGAM);
|
||||
registerFunctionAnalyses(FAM);
|
||||
P.registerModuleAnalyses(MAM);
|
||||
P.registerCGSCCAnalyses(CGAM);
|
||||
P.registerFunctionAnalyses(FAM);
|
||||
|
||||
// Cross register the analysis managers through their proxies.
|
||||
MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
|
||||
@@ -59,7 +61,8 @@ bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
|
||||
if (VK > VK_NoVerifier)
|
||||
MPM.addPass(VerifierPass());
|
||||
|
||||
if (!parsePassPipeline(MPM, PassPipeline, VK == VK_VerifyEachPass, DebugPM)) {
|
||||
if (!P.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