[LLVMdev] reusing FunctionPassManager with different Modules

Nick Lewycky nicholas at mxc.ca
Sat Sep 24 09:21:24 PDT 2011


On 09/23/2011 11:28 AM, Redmond, Paul wrote:
> Hi,
>
> Is it generally safe to cache a FunctionPassManager and reuse it on
> modules other than the one it was constructed with (assuming they have
> the same target triple)?

No. FunctionPass has a pair of methods, doInitialization and 
doFinalization, which take Module& and are allowed to read or modify it 
outside runOnFunction.

Nick



More information about the llvm-dev mailing list