diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index a56297fd58d..3b116074b71 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -43,6 +43,14 @@
All LoopPass execute on each loop in the function independent of +all of the other loops in the function. LoopPass processes loops in +loop nest order such that outer most loop is processed last.
+ +LoopPass subclasses are allowed to update loop nest using +LPPassManager interface. Implementing a loop pass is usually +straightforward. Looppass's may overload three virtual methods to +do their work. All these methods should return true if they modified the +program, or false if they didn't.
++ virtual bool doInitialization(Loop *, LPPassManager &LPM); +
+ virtual bool runOnLoop(Loop *, LPPassManager &LPM) = 0; +
+ +
The runOnLoop method must be implemented by your subclass to do +the transformation or analysis work of your pass. As usual, a true value should +be returned if the function is modified. LPPassManager interface +should be used to update loop nest.
+ ++ virtual bool doFinalization(); +
The doFinalization method is an infrequently used method that is +called when the pass framework has finished calling runOnLoop for every loop in the +program being compiled.
+ +