Hello,<br><br>I am seeing a weird behavior from getAnalysis<>.  I seem to not get back a valid object type, which leads to other errors.<br><br>when I am executing the following line: <br><br><span style="color: rgb(0, 0, 153);">InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>();</span><br>
<br>I am apparently getting back an object of type llvm::Pass;<br><br>This is how I checked it: with the following code I create the Object print its address value and add it to the pass manager<br><br><span style="color: rgb(0, 153, 0);">        InsertDummyTargsPass* p =  new InsertDummyTargsPass(bp, ipInfo, exeInfo);</span><br style="color: rgb(0, 153, 0);">
<span style="color: rgb(0, 153, 0);">        std::cerr << "dummytargspass :" << p;</span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">        llvm::Pass* parent = p;</span><br style="color: rgb(0, 153, 0);">
<span style="color: rgb(0, 153, 0);">        std::cerr << "value of parent:" << parent;</span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">        PM.add(p);</span> <br><br>
I get from the cerr statement<br><br><span style="color: rgb(204, 0, 0);">dummytargspass :0x971acd8</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">     value of parent:0x971acf4</span><br><br>
In the <span style="color: rgb(0, 153, 0);">InsertDummyTargsPass::runOnModule <span style="color: rgb(0, 0, 0);">I have the following statement<br><span style="color: rgb(0, 153, 0);"><br>printf("value of this %x\n", (unsigned int) this);<br>
<br><font color="#000000">which gives:<br><span style="color: rgb(204, 0, 0);">value of this 971acd8</span><br><br>then I use in a different pass<br><br><span style="color: rgb(51, 204, 0);">    InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>();</span><br style="color: rgb(51, 204, 0);">
<span style="color: rgb(51, 204, 0);">    printf("value of dt*  %x\n", (unsigned int) &dt);</span><br><br>which gives<br><span style="color: rgb(204, 0, 0);">value of dt*  971acf4<br><br><span style="color: rgb(0, 0, 0);">which suggests that I am getting back a reference of type llvm::Pass instead of  </span></span></font></span></span></span><span style="color: rgb(0, 0, 0);">InsertDummyTargsPass</span><span style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 153, 0);"><font color="#000000"><span style="color: rgb(204, 0, 0);"><span style="color: rgb(0, 0, 0);"> which is what I wanted. Can anyone tell how to fix this issue.<br>
<br><br>Pape<br>University of Maryland at College Park<br>ECE Department<br></span><br></span><br><br><br><br></font></span><br></span></span>