[llvm-dev] Error: Verify if there is a pass dependency cycle

Alexandre Isoard via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 13 22:57:53 PDT 2018


Hi,

You need to initialize your pass with:

INITIALIZE_PASS_BEGIN(YourPass, "your-pass", "Your Pass",
/*cfgonly=*/false, /*analysis=*/false)
INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
INITIALIZE_PASS_END(YourPass, "your-pass", "Your Pass", /*cfgonly=*/false,
/*analysis=*/false)

So as to both register your pass, and have PostDominatorTreeWrapperPass
(which is the Analysis pass in charge of creating the PostDominatorTree)
initialized before your pass.

It also give a pretty name to YourPass: "Your Pass"
And add an option to opt to run it: "-your-pass"


On Wed, Apr 11, 2018 at 9:39 PM, Qiuping Yi via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi everyone,
>
> I write a new FunctionPass which wants to use pass PostDominatorTree, so I
> implement the next function:
>
> void getAnalysisUsage(AnalysisUsage &AU) const {
>       AU.addRequired<PostDominatorTree>();
>       AU.setPreservesAll();
> }
>
> Then I get PDT through the next statement:
>
> PostDominatorTree *PDT = &getAnalysis<PostDominatorTree>();
>
> My code can be successfully compiled. However, I encounter the next error
> when I ran the code:
>
> *Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.*
> *Verify if there is a pass dependency cycle.*
> *Required Passes:*
>
> I used llvm-3.4. Any comments are welcome. Thanks!
>
>
> Best regards,
>
> Qiuping Yi
> Institute Of Software
> Chinese Academy of Sciences
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 
*Alexandre Isoard*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180413/08c98088/attachment.html>


More information about the llvm-dev mailing list