diff options
author | Zixu Wang <zixu_wang@apple.com> | 2020-06-30 09:28:06 -0700 |
---|---|---|
committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2020-06-30 13:57:47 -0700 |
commit | 89a0c4066b0e70edd257e30d7189f303e26251a0 (patch) | |
tree | b0e0781b45e6d502d7932981e95b1610800e81c9 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ecae672ac2ac42bc15bdc794cc56ddccadec9e4f (diff) | |
download | llvm-89a0c4066b0e70edd257e30d7189f303e26251a0.zip llvm-89a0c4066b0e70edd257e30d7189f303e26251a0.tar.gz llvm-89a0c4066b0e70edd257e30d7189f303e26251a0.tar.bz2 |
[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>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8bd248c..e12931a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1688,6 +1688,9 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, } Opts.MessageLength = getLastArgIntValue(Args, OPT_fmessage_length_EQ, 0, Diags); + + Opts.UndefPrefixes = Args.getAllArgValues(OPT_Wundef_prefix_EQ); + addDiagnosticArgs(Args, OPT_W_Group, OPT_W_value_Group, Opts.Warnings); addDiagnosticArgs(Args, OPT_R_Group, OPT_R_value_Group, Opts.Remarks); |