[LLVMdev] How to use a FunctionPass in a ModulePass?

gauss gausszhch at gmail.com
Mon Aug 10 18:48:10 PDT 2009


Hi, Devang. Thank you for your reply. 

But in my case, my ModulePass requires another FunctionPass (e.g.
MemoryDependenceAnalysis) rather than the opposite direction. Is it also
limited?

-
gauss




Devang Patel-2 wrote:
> 
> On Mon, Aug 10, 2009 at 3:35 AM, gauss<gausszhch at gmail.com> wrote:
>> Hi, all:
>>
>> I wanted to use a FunctionPass (e.g. MemoryDependenceAnalysis) in a
>> ModulePass, and then I used the method
>> "getAnalysis<MemoryDependenceAnalysis>(llvm::Function *)"  described at
>> http://llvm.org/docs/WritingAnLLVMPass.html#ModulePass to get the
>> FunctionPass. But , it still crashed when I invoked this pass in tool
>> 'opt'.
>>
>> However, if I change my pass to inherit from FunctionPass, then
>> everything
>> goes well. But I must use the ModulePass to solve my problem. What can I
>> do
>> now?
> 
> As the docs say, the function pass must not require any other module
> pass (or immutable pass) here. This is a limitation of current
> implementation. I'll update docs to list "immutable pass" explicitly.
> 
> -
> Devang
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-a-FunctionPass-in-a-ModulePass--tp24897593p24910475.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.





More information about the llvm-dev mailing list