With clang LibTooling API one can get a list of compiler predefines simply using clang::Preprocessor::getPredefines()
, but I cannot find any equivalent in libclang API. Is it possible to get a list of compiler predefines with libclang API?
Asked
Active
Viewed 459 times
1 Answers
3
I could list all predefines using the fact that they are present in the beginning of a translation unit. So after parsing I just listed all top-level cursors of CursorKind.MACRO_DEFINITION
that are not in any real location (cursor.location.file is None
using python bindings API)

Victor K
- 529
- 2
- 16