[llvm-dev] How to change the source of a bitcast operator in a call instruction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] How to change the source of a bitcast operator in a call instruction

Chris Lattner via llvm-dev

Hi

I am trying to write a llvm pass to set a call instruction target function to a different target. The call instruction looks like following:

notail call void bitcast (void (i64, i64, i64)* @monitor to void (i64, i8*, i64)*)(i64 2193551, i8* bitcast (i32 (...)** @qcmp to i8*), i64 %18), !dbg !25563

I want to replace target **monitor** to a different target **monitorA**. The callInst->setCalledFunction entirely remove the bitcast operator. The bitcast->setOperand(0, F) throws assert error. What should be the solution?

Note: I am working on clang version 7.0.0

--
Email Signature Email Signature
photograph
Mustakimur R. Khandaker
Graduate Research Assistant
p: +1 850-999-3635
e: [hidden email]
LOV-170, Department of Computer Science
Florida State University
ww2.cs.fsu.edu/~khandake/

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev