[LLVMdev] How to get the PostDominanceFrontier?

Chris Lattner sabre at nondot.org
Sat Sep 11 18:55:10 PDT 2004


On Thu, 9 Sep 2004, xia_yimin wrote:

> When analysing a function "fn", my FunctionPass needs some
> PostDominanceFrontier information of functions which are called by
> function "fn".

Okay, first problem is that your algorithm does not qualify as a
FunctionPass: it should be a general Pass, because it looks at more than
one function at a time.

> getAnalysis<PostDominanceFrontier>() cannot give the information,
> because it only gives the PostDominanceFrontier information of "fn", not
> the PostDominanceFrontier information of functions called by "fn".

Yes.

> How to get the PostDominanceFrontier information of functions which are
> called by "fn"?

Unfortunately, there is no way to do this currently.  The problem is that
Pass instances cannot "require" FunctionPass instances.  This is a
long-standing deficiency (e.g., see:
http://llvm.cs.uiuc.edu/docs/WritingAnLLVMPass.html#PassFunctionPass, and
http://llvm.cs.uiuc.edu/PR36), and has been annoying in many different
cases.  However, until it bothers someone enough to fix it, it probably
won't be addressed.

Sorry!

-Chris

-- 
http://llvm.org/
http://nondot.org/sabre/




More information about the llvm-dev mailing list