I'm writing a gcc (version 5.4.0) plugin, which is intend to instrument some codes in functions. It's easy to do that by inserting some rtx or gimple instructions in a certain function:
a = foo();
instrument codes here;
b = foo();
But since the context in functions could be different, I'd like to instrument a call to my function, like:
a = foo();
call to instrument my function;
b = foo();
The problem is that I can't find a way to add my function, neither in gcc or with plugin. There's a related question: how-to-add-a-builtin-function-in-a-gcc-plugin, but it doesn't solve my problem. Any suggestions?