I'm working on a LLVM pass where I'm interested in calls on function pointers. Besides from knowing what the pointer actually points too (or what will actually be called) I would like to have the function pointer itself.
So from CallInst::getCalledValue() I can get the function that will be called, I want the function pointer that was actually used.
In this example, I would like to get ptr1 (address, varia开发者_StackOverflow社区ble object itself, name, something):
int main() {
int (*ptr1)(int) = &f1;
ptr1(42);
return 0;
}
Then you aren't working on a pass and should just modify clang to get you calls through function pointers and put out the information somewhere.
加载中,请稍侯......
精彩评论