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 ( 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?