[PATCH] D129061: [Lex] Diagnose macro in command lines

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 5 05:54:38 PDT 2022


aaron.ballman added a reviewer: serge-sans-paille.
aaron.ballman added a comment.

Thank you for looking into this! I think we may need to figure out something better for handling macros defined by the driver, because otherwise we're going to get a bunch of false positives from this. For example, the clang-cl driver adds command line flags like `-D_DEBUG` and `-D_MT`, etc, the same as what happens for `__GCC_HAVE_DWARF2_CFI_ASM`. I'm not certain if there's an easy way to differentiate between driver-added `-D` flags and user-added `-D` flags, though. If we don't have anything that suffices already, we could invent something (either a new form of `-D` at the cc1 level that the driver emits for its defines, or some sort of cc1 flag to say "here's where user command line options begin", etc).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129061



More information about the cfe-commits mailing list