[LLVMdev] How to avoid my sub Pass being executed automatically by AU.addRequired<***> grammar?

Shen Liu shl413 at lehigh.edu
Tue May 12 11:55:29 PDT 2015


Dear llvm developers,

As an llvm beginner I have a simple question. Would a callee pass be
executed at the very beginning, if i use AU.addRequired<>() grammar in my
upper level pass?  If yes, what can i do to stop it and make each callee
pass can be executed strictly by myself(e.g. using getAnalysis<>)?

I paste a piece of my code as follows, the two callee passes:
DataDependencyGraph and ControlDependencyGraph are always called before I i
use getAnalysis<> explicitly, which leads that my initialization work
cannot be done correctly.

Thanks very much!

code:

bool ProgramDependencyGraph::runOnModule(Module &M)
{
  for(Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
    {
       DataDependencyGraph &ddgGraph = getAnalysis<DataDependencyGraph>(*F);

       ControlDependencyGraph &cdgGraph =
getAnalysis<ControlDependencyGraph>(*F);
       ....
    }
}


void ProgramDependencyGraph::getAnalysisUsage(AnalysisUsage &AU) const
{
  AU.addRequired<ControlDependencyGraph>();
  AU.addRequired<DataDependencyGraph>();
  AU.setPreservesAll();
}

Best regards,

Shen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150512/c49b1c4e/attachment.html>


More information about the llvm-dev mailing list