[LLVMdev] Question on using analysis passes to do program analysis

Li Xuan Ji xuanji at gmail.com
Sun Dec 5 23:04:40 PST 2010


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>


More information about the llvm-dev mailing list