[llvm-dev] Example of using RGPassManager?

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 18 22:06:50 PST 2021


Probably it's because RegionPrinterPass also depends on a FunctionPass
analysis, such as DominatorTree. Try creating a function pass and
adding createRegionPrinterPass() to it, it will create the
RGPassManager for you.

Michael

Am Do., 18. Feb. 2021 um 22:33 Uhr schrieb Zhang via llvm-dev
<llvm-dev at lists.llvm.org>:
>
> Hi:
> My pass needs to run on LLVM Regions, I'm currently using the following code
> ```
> RGPassManager RPM;
> RPM.add(createRegionPrinterPass());
> RPM.doInitialization(M);
> for (Function &func : M.functions()) {
>   RPM.runOnFunction(func);
> }
> RPM.doFinalization(M);
> ```
>
> However when adding the pass, it asserts with PMTopLevelManager::findAnalysisUsage due to top level pass manager is null
>
> Zhang
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list