For the Pass Manager to work optimally it needs to know the dependencies between the Passes. Each of the passes can itself declare its dependencies: the analysis passes that need to be executed before this pass is executed and the passes that will get invalidated after the current pass is run. To specify these dependencies, a pass needs to implement the getAnalysisUsage
method.
virtual void getAnalysisUsage(AnalysisUsage &Info) const;
Using this method the current pass can specify the required and invalidated sets by filling in the details in the AnalysisUsage
object. To fill in the information the Pass needs to call any of the following methods: