diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-25 03:36:28 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-25 03:36:28 +0000 |
| commit | bc6aaea3364729cbd29a114e9e1f62ebe34defe3 (patch) | |
| tree | a6c34c4fd0996e1af12ada94da4bd9ba127cd225 /clang | |
| parent | 5b8a1bd4a2409f9ae5715911ba9c14203aeccf5e (diff) | |
| download | bcm5719-llvm-bc6aaea3364729cbd29a114e9e1f62ebe34defe3.tar.gz bcm5719-llvm-bc6aaea3364729cbd29a114e9e1f62ebe34defe3.zip | |
Driver: ignore -fno-objc-arc-exception when -fno-objc-arc set
Sometime clang would be supplied -fobjc-arc -f(no)objc-arc-exceptions
and then later disable ARC with -fno-objc-arc, which only negate first
option, but not the latter, resulting usused argument warning. Silence
this warning only when -fno-objc-arc option is present.
Patch by Onha Choe!
llvm-svn: 293014
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 | ||||
| -rw-r--r-- | clang/test/Driver/no-arc-exception-silence.m | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index c78123b236d..854b5d5cccb 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6018,7 +6018,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fno_objc_arc_exceptions, /*default*/ types::isCXX(InputType))) CmdArgs.push_back("-fobjc-arc-exceptions"); + } + // Silence warning for full exception code emission options when explicitly + // set to use no ARC. + if (Args.hasArg(options::OPT_fno_objc_arc)) { + Args.ClaimAllArgs(options::OPT_fobjc_arc_exceptions); + Args.ClaimAllArgs(options::OPT_fno_objc_arc_exceptions); } // -fobjc-infer-related-result-type is the default, except in the Objective-C diff --git a/clang/test/Driver/no-arc-exception-silence.m b/clang/test/Driver/no-arc-exception-silence.m new file mode 100644 index 00000000000..96b700d8352 --- /dev/null +++ b/clang/test/Driver/no-arc-exception-silence.m @@ -0,0 +1,2 @@ +// RUN: %clang -Werror -fobjc-arc -fobjc-arc-exceptions -fno-objc-arc -Xclang -verify -c %s +// expected-no-diagnostics |

