Using LoopInfo in a ModulePass

I'm writing a ModulePass that does work on a subset of the functions in a module.

I would like to get the LoopInfo for the functions that it works with. Is there some way to do this? As I understand, only a FunctionPass can register LoopInfo as a required analysis.

Hans

LoopInfo is a FunctionPass and a ModulePass can use FunctionPass in
certain cases. So you can do
   getAnalysis<LoopInfo>(Fn)
to get loop info for Fn. Fn must be a function definition.

See, http://llvm.org/docs/WritingAnLLVMPass.html#ModulePass