1

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?

Victor K
  • 529
  • 2
  • 16

1 Answers1

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