Reputation: 35
%1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str, i64 0, i64 0), i32 7) #3
For the above instruction, how can I check whether the call instruction contains printf ?
Upvotes: 0
Views: 419
Reputation: 1628
Just compare the name of the called function:
bool isPrintfCall(CallInst &C) {
auto *F = C.getCalledFunction();
auto isPrintf = (F->getName() == "printf");
return isPrintf;
}
Upvotes: 1