[clang][diagnostics] Add '-Wundef-prefix' warning option
authorZixu Wang <zixu_wang@apple.com>
Tue, 30 Jun 2020 16:28:06 +0000 (09:28 -0700)
committerCyndy Ishida <cyndy_ishida@apple.com>
Tue, 30 Jun 2020 20:57:47 +0000 (13:57 -0700)
commit89a0c4066b0e70edd257e30d7189f303e26251a0
treeb0e0781b45e6d502d7932981e95b1610800e81c9
parentecae672ac2ac42bc15bdc794cc56ddccadec9e4f
[clang][diagnostics] Add '-Wundef-prefix' warning option

Summary:
Add an `-Wundef-prefix=<arg1>,<arg2>...` option, which is similar to `-Wundef`, but only give warnings for undefined macros with the given prefixes.

Reviewers: ributzka, steven_wu, cishida, bruno, arphaman, rsmith

Reviewed By: ributzka, arphaman

Subscribers: riccibruno, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80751

This patch was authored by Zixu Wang <zixu_wang@apple.com>
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.c [new file with mode: 0644]