[LLVMdev] How to create a Function type @x = external global void ()*

Hayden Livingston halivingston at gmail.com
Wed Feb 18 10:08:16 PST 2015


Hello,

I'm trying to generate LLVM IR that looks like:

@x = external global void ()*

I've spent some time looking and staring at LLVM docs, but can't go from:

@x = external global void ()

to the desired * notation

And therefore when I try to call it, it fails, because I've added the
global mapping for x to be a pointer location where the function I'm
calling resides.

Here is the IR today, and I'm guessing the @x() call would be changed to
load and then call indirect or something.

define double @sum(double, double) {
entry:
  call void @x()
  %tmp = fadd double %0, %1
  ret double %tmp
}

Help much appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150218/101a4df3/attachment.html>


More information about the llvm-dev mailing list