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

Mustakim via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 29 07:05:50 PDT 2019


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 callvoidbitcast(void(i64, i64, i64)* @monitortovoid(i64, i8*, 
i64)*)(i642193551, i8*bitcast(i32(...)** @qcmptoi8*), 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 

Note: I am working on clang version 7.0.0

Email Signature Email Signature
*Mustakimur R. Khandaker
* Graduate Research Assistant
*p:*+1 850-999-3635
*e:*mrk15e at my.fsu.edu
LOV-170, Department of Computer Science
Florida State University
ww2.cs.fsu.edu/~khandake/ <http://ww2.cs.fsu.edu/~khandake/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190429/5900d8d8/attachment.html>

More information about the llvm-dev mailing list