From ea6edcb461554e7a2f6dab41daa953d634a0b0ff Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Mon, 19 May 2014 23:48:49 +0000 Subject: [PATCH] ARCMT/GC-check-warn-nsalloc.m: don't provide a diag group This diagnostic is now controlled solely by -no-ns-alloc-error thus matching the original intended behaviour. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209184 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticCommonKinds.td | 2 +- lib/ARCMigrate/ARCMT.cpp | 4 ++-- test/ARCMT/GC-check-warn-nsalloc.m | 5 ++--- test/Misc/warning-flags.c | 3 ++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index b6260627c7..74d628e519 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -143,7 +143,7 @@ def warn_mt_message : Warning<"[rewriter] %0">; def note_mt_message : Note<"[rewriter] %0">; // ARCMigrate -def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">, InGroup>, DefaultError; +def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">; def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">; } diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 88ff50fcf9..617bb6875e 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -311,9 +311,9 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI, MigrationPass pass(Ctx, OrigGCMode, Unit->getSema(), testAct, capturedDiags, ARCMTMacroLocs); pass.setNoFinalizeRemoval(NoFinalizeRemoval); - if (NoNSAllocReallocError) + if (!NoNSAllocReallocError) Diags->setDiagnosticMapping(diag::warn_arcmt_nsalloc_realloc, - diag::MAP_IGNORE, SourceLocation()); + diag::MAP_ERROR, SourceLocation()); for (unsigned i=0, e = transforms.size(); i != e; ++i) transforms[i](pass); diff --git a/test/ARCMT/GC-check-warn-nsalloc.m b/test/ARCMT/GC-check-warn-nsalloc.m index 19a8d3dc5f..44ccc95e3f 100644 --- a/test/ARCMT/GC-check-warn-nsalloc.m +++ b/test/ARCMT/GC-check-warn-nsalloc.m @@ -1,6 +1,5 @@ -// RUN: %clang_cc1 -arcmt-check -Werror -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s -// RUN: %clang_cc1 -arcmt-check -Wno-error=arcmt-ns-alloc -triple x86_64-apple-darwin10 -fobjc-gc-only %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory' -// RUN: %clang_cc1 -arcmt-check -Werror -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s +// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory' +// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory' // TODO: Investigate VerifyDiagnosticConsumer failures on these tests when using -verify. // rdar://10532541 diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 415e1986fc..5a45172ed2 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,7 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (105): +CHECK: Warnings without flags (106): CHECK-NEXT: ext_delete_void_ptr_operand CHECK-NEXT: ext_expected_semi_decl_list CHECK-NEXT: ext_explicit_specialization_storage_class @@ -45,6 +45,7 @@ CHECK-NEXT: pp_pragma_sysheader_in_main_file CHECK-NEXT: w_asm_qualifier_ignored CHECK-NEXT: warn_accessor_property_type_mismatch CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size +CHECK-NEXT: warn_arcmt_nsalloc_realloc CHECK-NEXT: warn_asm_label_on_auto_decl CHECK-NEXT: warn_bitfield_width_exceeds_type_size CHECK-NEXT: warn_braces_around_scalar_init -- 2.40.0