[PATCH] D80751: [clang][diagnostics] Add '-Wundef-prefix' warning option

Zixu Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 28 12:05:57 PDT 2020


zixuw created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
zixuw added reviewers: ributzka, steven_wu, cishida, bruno, arphaman.
Herald added a subscriber: dexonsmith.
zixuw edited the summary of this revision.

- Add an `-Wundef-prefix=<arg1>,<arg2>...` option, which is similar to `-Wundef`, but only give warnings for undefined macros with the given prefixes.
- Make `-Wundef` an alias of `-Wundef-prefix=""` so that when the two options are given together, `-Wundef` takes precedence over `-Wundef-prefix`, as all strings are prefixed by the empty string.

rdar://55684778


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80751

Files:
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Basic/DiagnosticOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/Lex/PPExpressions.cpp
  clang/test/Preprocessor/warn-macro-undef-prefix.c
  clang/test/Preprocessor/warn-macro-undef.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80751.266979.patch
Type: text/x-patch
Size: 6528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200528/a2443097/attachment.bin>


More information about the cfe-commits mailing list