Thanks!Best regards,Shen
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Thanks for your helpful answer David! But one thing still makes me confused is when i use isa<CallInst> to check the original instruction the answser is yes.
, which implies it is a callinst. Since it is not a CallInst, why does llvm add an opcode "call" before it? It looks a little weird here.
Shen
On Thu, Nov 12, 2015 at 10:48 PM, David Blaikie <dbla...@gmail.com> wrote:
Hi all,
Usually if we want to get the called Function we can directly use CallInst->getCalledFunction(), however, today i encounter an unusual CallInst as follows:
%call11 = call double (...)* bitcast (double ()* @quantum_frand to double (...)*)()
the original C source involve type cast:
float u,v;
extern double quantum_frand();
u = 2 * quantum_frand() - 1;v = 2 * quantum_frand() - 1;
In this case, CallInst->getCalledFunction() returns a nullptr unusually, I printed out the getOperand(0) and found the operand is the whole thing of "double (...)* bitcast (double ()* @quantum_frand to double (...)*)()". Any member function calling on that fails so i don't know whether there is an efficient way to exactly get the called function @quantum_frand(...) here? Thanks!
Best regards,
Shen
_______________________________________________ LLVM Developers mailing list llvm...@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell