<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 30, 2015 at 5:19 PM, Robison, Arch <span dir="ltr"><<a href="mailto:arch.robison@intel.com" target="_blank">arch.robison@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Suppose I want to define an intrinsic that takes a pointer to a routine. E.g., an intrinsic version of qsort, or for argument's sake, an intrinsic form for this hypothetical routine:<br>
<br>
void* foobitize(void thunk(void*,void*));<br>
<br>
How do I defined the intrinsic in llvm/IR/Intrinsics.td ? It looks like I need to define a new class, but I'm lost about what I need to do. There doesn't seem to be any prior examples of intrinsics that take pointers to routines.<br>
<br>
This not something I'm planning to submit as a commit; it's just part of an experiment.<br></blockquote><div><br></div><div>I think there are some intrinsics which just take llvm_ptr_ty and require their callers to bitcast to i8*.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
- Arch D. Robison<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>
</blockquote></div><br></div></div>