Something's different here, earlier in the thread you said you had:<br>void getAnalysisUsage(AnalysisUsage &AU) const {<br>
                AU.addRequired<DominatorTree>();<br><div id=":w2">
}</div><br>Now you have:<br>void getAnalysisUsage(AnalysisUsage &AU) const {<br>
                DominatorTree *dt = &getAnalysis<DominatorTree>();<br><br>I'm sort of confused, why did this change happen? I think the "AU.addRequired" was correct to have in getAnalysisUsage, and the "getAnalysis" goes e.g. in the top of runOnFunction/Module/Whatever. Sorry if I misunderstood what's going on.<br>

<br><div class="gmail_quote">On Tue, Nov 8, 2011 at 12:50 PM, ret val <span dir="ltr"><<a href="mailto:retval386@gmail.com">retval386@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Just shows me what I expect<br>
        void getAnalysisUsage(AnalysisUsage &AU) const {<br>
                DominatorTree *dt = &getAnalysis<DominatorTree>();<br>
<br>
So I'm only using it for DominatorTree(so I can use PromoteMemToReg).<br>
<br>
Thanks<br>
<div><div></div><div class="h5"><br>
On Tue, Nov 8, 2011 at 2:28 PM, Tobias Grosser <<a href="mailto:tobias@grosser.es">tobias@grosser.es</a>> wrote:<br>
> On 11/08/2011 07:33 PM, ret val wrote:<br>
>><br>
>> Sorry to keep dragging this out on you. Im now getting: Assertion<br>
>> failed: (ResultPass&&  "getAnalysis*() called on an analysis that was<br>
>> not " "'required' by pass!"), function getAnalysisID<br>
>><br>
>> But I already have:<br>
>> void getAnalysisUsage(AnalysisUsage&AU) const {<br>
>>                AU.addRequired<DominatorTree>();<br>
>> }<br>
>><br>
>> And changed the bottom of my pass too:<br>
>><br>
>> char Hello::ID = 0;<br>
>> namespace llvm { void initializeHelloPass(llvm::PassRegistry&); }<br>
>> INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true)<br>
>> INITIALIZE_PASS_DEPENDENCY(DominatorTree)<br>
>> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true)<br>
>><br>
>> class StaticInitializer {<br>
>> public:<br>
>>        StaticInitializer() {<br>
>>                PassRegistry&Registry = *PassRegistry::getPassRegistry();<br>
>>                initializeHelloPass(Registry);<br>
>>        }<br>
>> };<br>
>><br>
>> static StaticInitializer InitializeEverything;<br>
><br>
> Looks good to me. Are you sure you call getAnalysis only for the<br>
> DominatorTree? What is the output of "grep getAnalysis YourPass.cpp"?<br>
><br>
> Cheers<br>
> Tobi<br>
><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br>