A noble thought when making developer tooling:
I will use clang as a library to parse this code!
The reality:
- You made the mistake of trying to use libclang instead of the clang C++ API.
- Your project needs a
compile_commands.json
database anyway, so now you have to retrofit it onto your build system. - The super powerful IPC system built with custom attributes you were going to implement doesn't work because of an unreasonable limitation of the API. Now you have figure out how to make your attributes fit into a single string.
- Your clang tool requires including 20 LLVM headers and takes about 30 seconds to compile, even though you just have a single file.
- The
PPCallbacks
subclass you made to grab the preprocessor output is useless.