I'm using clang's libtooling to modify some code and I'm trying to find a way to safely insert a header whenever my tool is used on a C file.
I've read What's the right way to match #includes (or #defines) using Clang's libtooling? question about match calls to the preprocessors but I'm still uncertain about using it to insert code.
What is the proper way to insert a new #include using libtooling rewriter?