clang-tutor
clang-tutor copied to clipboard
Example for instrumenting source code
Thank you! This is very helpful. Do you have any example plugins for adding functions to source code? I would like an example for adding a new function, with simple and complex variables(like structures ), which also uses inputs form the original source code. For example, an example plugin to ASTMatcher and Rewriter/Refactoring/Replacement tools in a plugin.
Hi @ArchanaaSK,
Thank you for visiting and for your question!
Do you have any example plugins for adding functions to source code?
No, I've not tried implementing anything like that for Clang. Do you have a motivating example? This could be an interesting thing to try! Although, to be perfectly honest, I'm not sure where such function should be defined.
I did implement something similar for LLVM IR. See here and here.