modulepass requiring a functionpass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

modulepass requiring a functionpass

Ryan M. Lefever
I have a ModulePass, which we'll call MP, that generates a dependency
graph for an entire program.  I want MP to require the
UnifyFunctionExitNodes pass, which is a FunctionPass.  Since its not
possible to make a ModulePass depend on a FunctionPass, is my only
choice to make MP a FunctionPass in which the runOnFunction() routine
does nothing, and the doFinalization routine does all the work that the
runOnModule() pass did when MP was a ModulePass?

Regards,
Ryan
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: modulepass requiring a functionpass

Chris Lattner
On Sun, 8 Oct 2006, Ryan M. Lefever wrote:
> I have a ModulePass, which we'll call MP, that generates a dependency
> graph for an entire program.  I want MP to require the
> UnifyFunctionExitNodes pass, which is a FunctionPass.  Since its not
> possible to make a ModulePass depend on a FunctionPass, is my only
> choice to make MP a FunctionPass in which the runOnFunction() routine
> does nothing, and the doFinalization routine does all the work that the
> runOnModule() pass did when MP was a ModulePass?

Yes.  Alternatively, you could arrange for the unifyfunctionexitnodes pass
to always be run before yours through other ways: i.e. always pass the
option to opt or something.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev