[LLVMdev] AnalysisUsage: addRequired vs. addRequiredTransitive

Trevor Harmon Trevor.W.Harmon at nasa.gov
Thu Apr 1 17:40:26 PDT 2010

On Apr 1, 2010, at 4:59 PM, Andreas Bolka wrote:

> Nope. If Foo depends on MDA, then Foo does addRequired<MDA>(). But  
> when
> Foo uses MDA, MDA itself needs AA. So MDA does
> addRequiredTransitive<AA>() as AA does not only need to be around  
> within
> MDA's runOnFunction but also within each runOnFunction of a pass
> depending on MDA.
> So if MDA does addRequired<AA>, AA is only guaranteed to be alive for
> MDA's runOnFunction. If MDA does addRequiredTransitive<AA> instead, AA
> is not only alive for MDA's runOnFunction, but also for all
> runOnFunction-s of passes requiring MDA.

I get it now; thanks.

By the way, how can I help put this MDA/AA example into the LLVM  
documentation? There are a lot of explanations like this that should  
be preserved in the docs someplace, but I don't know what the usual  
procedure is for getting them there.


More information about the llvm-dev mailing list