Li Xuan Ji
2010-Dec-06 07:04 UTC
[LLVMdev] Question on using analysis passes to do program analysis
Hi everyone, I'm doing a bit of hacking on klee, which uses the llvm libraries. For my purposes it would be most useful to know the information that the RegionInfo pass (http://wiki.llvm.org/RegionInfo) produces; for instance, I would like to take a BasicBlock and find out whether it terminates a region, etc. Now the thing is I have a pointer to a llvm::Module, and I know that you can create a llvm::PassManager, add passes to it (through llvm::createRegionInfoPass()), and then call PassManager::run. My question is, after the passes are run, how do I get access to the information that the passes produce? The RegionInfo class defines some public functions that I would like to call, but after I call PassManager::run the functions don't return anything sensible. Looking through opt.cpp I think you have to call getAnalysisID or getAnalysis but I'm not sure how to use them. Can someone help? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101206/aa7a583e/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Assertion failure on region analysis
- [LLVMdev] Assertion failure on region analysis
- [LLVMdev] How to require ScalarEvolution analysis in a Module pass?
- [LLVMdev] Pass Incompatibility
- [LLVMdev] How to prevent optimizations and preserve program variables during link?