<div dir="ltr">IntrinsicInst is a subclass of CallInst, so your code should work just fine on intrinsics. It would be helpful if you can upload your (reduced) IR. </div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 23, 2014 at 1:08 AM, 李永超 <span dir="ltr"><<a href="mailto:lyc364@gmail.com" target="_blank">lyc364@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi,</div><div> Following is my piece of code:</div><div> </div><div> Instruction * ins = /* something */;</div><div> CallInst * callInst = NULL;</div><div> if(callInst = dyn_cast<CallInst>(ins)) {</div>
<div> // non-related code omitted</div><div> }</div><div><br></div><div> </div><div> What the code try to do is interpreting LLVM IR and do some operation. </div><div> dyn_cast returns the expected pointer to CallInst for function calling instruction like strcpy. </div>
<div> However, it returns NULL when the instruction calls memset, memcpy or memmove.</div><div> I know LLVM has its own intrinsic for memmove, memset and memcpy, in format like, llvm.memcpy.*.</div><div><br></div><div>
My question is: doesn`t dyn_cast works for calling instructions for memmove, memset? Or should I</div><div> invoke some other API in LLVM to obtain a pointer to CallInst type?</div><div><br></div><div>Thanks,</div><div>
<span style="line-height:1.5">Yongchao</span></div><div></div><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>
<br></blockquote></div><br></div>