From 65513605353c7e3ee8be6fc92892f257ad399d92 Mon Sep 17 00:00:00 2001
From: Tobias Grosser
RegionPass is similar to LoopPass, +but executes on each single entry single exit region in the function. +RegionPass processes regions in nested order such that the outer most +region is processed last.
+ +RegionPass subclasses are allowed to update the region tree by using +the RGPassManager interface. You may overload three virtual methods of +RegionPass to implementing your own region pass is usually. All these +methods should return true if they modified the program, or false if they didn not. +
++ virtual bool doInitialization(Region *, RGPassManager &RGM); +
The doInitialization method is designed to do simple initialization +type of stuff that does not depend on the functions being processed. The +doInitialization method call is not scheduled to overlap with any +other pass executions (thus it should be very fast). RPPassManager +interface should be used to access Function or Module level analysis +information.
+ ++ virtual bool runOnRegion(Region *, RGPassManager &RGM) = 0; +
+ +
The runOnRegion 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 region is modified. RGPassManager interface +should be used to update region tree.
+ ++ virtual bool doFinalization(); +
The doFinalization method is an infrequently used method that is +called when the pass framework has finished calling runOnRegion for every region in the +program being compiled.
+ +