[LLVMdev] How can I determine safely if a CallSite is "live" in a DSGraphs context

Kevin Streit kevin.streit at googlemail.com
Mon Dec 13 09:26:15 PST 2010


Hi,

I'm using DSAnalysis in order to get some points to information. In my particular case for a CallSite. 
Everything is working well except for some special cases. Consider the following example code:

// ======================

   void m(short *s) {
       return;
   }

   int main() {
       m(0);
   }

// ======================

The call to method m in the main method is translated to "call void @m(i16* null) nounwind ssp".
If I try to call getDSCallSiteForCallSite(...) with the above mentioned CallSite as argument on the DSGraph of the main method I get a failing assertion when the getDSCallSiteForCallSite method tries to get the DSNode (via getNodeForValue(...)) for the "i16* null" argument. So it obviously thinks it should have a node for that value (since shouldHaveNodeForValue(i16* null) returns true) and thus calls getNodeForValue, which raises the error (The node is not contained in the ScalarMap).

I tried to verify if I'm using the analysis correctly by invoking the poolalloc tool on the program which raises a completely different error.

So under which circumstances is it safe to call getDSCallSiteForCallSite?

Or stated otherwise: Should shouldHaveNodeForValue() return true for a ConstantPointerNullValue?

Thanks, Kevin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101213/cc0d8111/attachment.bin>


More information about the llvm-dev mailing list