NoQ added a comment.

It sounds like the code is querying the temporary internal state of the 
preprocessor which is supposed to be queried during preprocessing, not after 
it. Say, `PP.isMacroDefined("__STDC_LIB_EXT1__")` clearly depends on the 
location, as a macro can be un-defined and re-defined as many times as 
possible. But it doesn't receive the location as an argument, so it's probably 
implied to be "the location that the preprocessor is currently 
preprocessing"(?) Like, i've no idea how does the `Preprocessor` class work, 
but the code clearly looks too primitive to solve the problem. Clang-Tidy's 
`PPCallbacks` subsystem looks much more realistic.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69731/new/

https://reviews.llvm.org/D69731



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to