Robison, Arch
2015-Apr-30 21:19 UTC
[LLVMdev] How to declare intrinsic that takes pointer to routine?
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: void* foobitize(void thunk(void*,void*)); 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. This not something I'm planning to submit as a commit; it's just part of an experiment. - Arch D. Robison
David Majnemer
2015-Apr-30 22:16 UTC
[LLVMdev] How to declare intrinsic that takes pointer to routine?
On Thu, Apr 30, 2015 at 5:19 PM, Robison, Arch <arch.robison at intel.com> wrote:> 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: > > void* foobitize(void thunk(void*,void*)); > > 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. > > This not something I'm planning to submit as a commit; it's just part of > an experiment. >I think there are some intrinsics which just take llvm_ptr_ty and require their callers to bitcast to i8*.> > - Arch D. Robison > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150430/89ab1340/attachment.html>