Hello,
I am seeing a weird behavior from getAnalysis<>. I seem to not get back a
valid object type, which leads to other errors.
when I am executing the following line:
InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>();
I am apparently getting back an object of type llvm::Pass;
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
InsertDummyTargsPass* p = new InsertDummyTargsPass(bp, ipInfo,
exeInfo);
std::cerr << "dummytargspass :" << p;
llvm::Pass* parent = p;
std::cerr << "value of parent:" << parent;
PM.add(p);
I get from the cerr statement
dummytargspass :0x971acd8
value of parent:0x971acf4
In the InsertDummyTargsPass::runOnModule I have the following statement
printf("value of this %x\n", (unsigned int) this);
which gives:
value of this 971acd8
then I use in a different pass
InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>();
printf("value of dt* %x\n", (unsigned int) &dt);
which gives
value of dt* 971acf4
which suggests that I am getting back a reference of type llvm::Pass instead
of InsertDummyTargsPass which is what I wanted. Can anyone tell how to fix
this issue.
Pape
University of Maryland at College Park
ECE Department
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100914/d1d8011c/attachment.html>
I think you need to implement getAdjustedAnalysisPointer() in your pass. Eugene On Tue, Sep 14, 2010 at 4:40 PM, Pape Sylla <papesylla at gmail.com> wrote:> Hello, > > I am seeing a weird behavior from getAnalysis<>. I seem to not get back a > valid object type, which leads to other errors. > > when I am executing the following line: > > InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>(); > > I am apparently getting back an object of type llvm::Pass; > > 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 > > InsertDummyTargsPass* p = new InsertDummyTargsPass(bp, ipInfo, > exeInfo); > std::cerr << "dummytargspass :" << p; > llvm::Pass* parent = p; > std::cerr << "value of parent:" << parent; > PM.add(p); > > I get from the cerr statement > > dummytargspass :0x971acd8 > value of parent:0x971acf4 > > In the InsertDummyTargsPass::runOnModule I have the following statement > > printf("value of this %x\n", (unsigned int) this); > > which gives: > value of this 971acd8 > > then I use in a different pass > > InsertDummyTargsPass& dt = getAnalysis<InsertDummyTargsPass>(); > printf("value of dt* %x\n", (unsigned int) &dt); > > which gives > value of dt* 971acf4 > > which suggests that I am getting back a reference of type llvm::Pass instead > of InsertDummyTargsPass which is what I wanted. Can anyone tell how to fix > this issue. > > > Pape > University of Maryland at College Park > ECE Department > > > > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Apparently Analagous Threads
- [LLVMdev] getAnalysis()
- [LLVMdev] getAnalysis()
- [LLVMdev] Re: getAnalysis
- [LLVMdev] getAnalysis*() called on an analysis that was not " "'required' by pass!
- [LLVMdev] Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed.