[llvm-dev] creating a callinst to an external function

marwayusuf@feng.bu.edu.eg via llvm-dev
Wed, 09 Sep 2015 14:21:15 -0000

Thanks a million for your help.
foo function is properly called now, if I pass no parameters. However, it stops
if I try to pass an llvm Function as a prameter.
The problem arises if I try to perform any operation (like getName) on this
passed function. It gives me a segmentation fault. I checked and found it's
not NULL.
I understood from your answer that I should convert the function pointer into an
integer that represents its address and then convert it back into a pointer in
the instrumented IR. However, I could not get how exactly to do that. I tried
some code but with no luck. If you please explain the idea more, I'll
appreciate. Thanks in advance.

Regards,
Marwa Yusuf
Teaching Assistant - Computer Engineering Department
Faculty of Engineering - Benha University
E-JUST PhD Student
Computer Science & Engineering Dept.

________________________________________
From: Tim Northover <t.p.northover at gmail.com>
Sent: Wednesday, September 2, 2015 4:37 PM
To: marwayusuf at feng.bu.edu.eg
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] creating a callinst to an external function