Finding of functions and inserting code


I’d like to ask you if it is possible to find the lines of my code where the specific functions is called and insert some code around function’s block.

Example of code:

10: some code
11: foo()
12: some code

Example of output:

10: some code
11: inserted code
12: foo()
13: inserted code
14: some code

foo() was called on line 11

Is it possible with Clang?

Thank you for your answers!