[llvm-dev] Run llvm pass from standalone project
Akash Banerjee via llvm-dev
llvm-dev at lists.llvm.org
Mon Jul 22 02:55:30 PDT 2019
Hi all,
I am trying to use LLVM's AliasAnalysis pass, but from a standalone tool
that uses llvm libraries.
The following is the code snippet I am currently using.
PassBuilder PB;
auto mod_manager = ModuleAnalysisManager { };
PB.registerModuleAnalyses(mod_manager);
AAResults& AAR = mod_manager.getResult<AAManager>(*M);
But the code fails at .getResult with the following error:
/llvm/include/llvm/IR/PassManager.h:778: typename PassT::Result&
llvm::AnalysisManager<IRUnitT, ExtraArgTs>::getResult(IRUnitT&, ExtraArgTs
...) [with PassT = llvm::AAManager; IRUnitT = llvm::Module; ExtraArgTs =
{}; typename PassT::Result = llvm::AAResults]: Assertion
`AnalysisPasses.count(PassT::ID()) && "This analysis pass was not
registered prior to being queried"' failed.
Aborted (core dumped)
Please point me towards some documentation that explains how to run llvm
passes from a standalone project.
Thanks,
Akash Banerjee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190722/5e72868a/attachment.html>
More information about the llvm-dev
mailing list