[LLVMdev] Chaining analyses from an analysis group

Nick Johnson npjohnso at cs.princeton.edu
Wed May 13 17:29:13 PDT 2009


Two questions regarding analysis groups that ``chain'' their results,
like AliasAnalysis.

(1) I have an analysis group, let's call it Provider.  I also have two
implementations of it: ProviderA and ProviderB.

The "writing a pass" document suggests using:

  au.addRequiredTransitive< Provider >();

Within the getAnalysisUsage() method of both ProviderA and ProviderB.

But... I'm doing something wrong, and I get an infinite recursion.

(2) ALSO, I'm confused.  Should I get the previous results using:

  Provider &previous = getAnalysis< Provider >();

But that returns a reference, so how could the last pass in the chain
call it if it doesn't exist?  Or, am I supposed to implement a
terminal pass, similar to NoAA?

Nick Johnson

More information about the llvm-dev mailing list