[cfe-commits] r149662 - in /cfe/trunk: lib/Basic/Diagnostic.cpp test/Analysis/null-deref-ps.c test/CodeGen/statements.c test/Sema/return.c test/SemaCXX/vararg-non-pod.cpp test/SemaObjCXX/vararg-non-pod.mm
Chad Rosier
mcrosier at apple.com
Thu Feb 2 17:49:51 PST 2012
Author: mcrosier
Date: Thu Feb 2 19:49:51 2012
New Revision: 149662
URL: http://llvm.org/viewvc/llvm-project?rev=149662&view=rev
Log:
[frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625
Modified:
cfe/trunk/lib/Basic/Diagnostic.cpp
cfe/trunk/test/Analysis/null-deref-ps.c
cfe/trunk/test/CodeGen/statements.c
cfe/trunk/test/Sema/return.c
cfe/trunk/test/SemaCXX/vararg-non-pod.cpp
cfe/trunk/test/SemaObjCXX/vararg-non-pod.mm
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Feb 2 19:49:51 2012
@@ -172,6 +172,13 @@
FullSourceLoc Loc(L, *SourceMgr);
FullSourceLoc LastStateChangePos = DiagStatePoints.back().Loc;
+ // Don't allow a mapping to a warning override an error/fatal mapping.
+ if (Map == diag::MAP_WARNING) {
+ DiagnosticMappingInfo &Info = GetCurDiagState()->getOrAddMappingInfo(Diag);
+ if (Info.getMapping() == diag::MAP_ERROR ||
+ Info.getMapping() == diag::MAP_FATAL)
+ Map = Info.getMapping();
+ }
DiagnosticMappingInfo MappingInfo = makeMappingInfo(Map, L);
// Common case; setting all the diagnostics of a group in one place.
Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Thu Feb 2 19:49:51 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wreturn-type
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wno-error=return-type
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wno-error=return-type
typedef unsigned uintptr_t;
Modified: cfe/trunk/test/CodeGen/statements.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/statements.c?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/statements.c (original)
+++ cfe/trunk/test/CodeGen/statements.c Thu Feb 2 19:49:51 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only
+// RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only
void test1(int x) {
switch (x) {
Modified: cfe/trunk/test/Sema/return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/test/Sema/return.c (original)
+++ cfe/trunk/test/Sema/return.c Thu Feb 2 19:49:51 2012
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Wignored-qualifiers -Wreturn-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
+// RUN: %clang %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
// clang emits the following warning by default.
// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
Modified: cfe/trunk/test/SemaCXX/vararg-non-pod.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/vararg-non-pod.cpp?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/vararg-non-pod.cpp (original)
+++ cfe/trunk/test/SemaCXX/vararg-non-pod.cpp Thu Feb 2 19:49:51 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s -Wnon-pod-varargs
+// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s -Wno-error=non-pod-varargs
extern char version[];
Modified: cfe/trunk/test/SemaObjCXX/vararg-non-pod.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/vararg-non-pod.mm?rev=149662&r1=149661&r2=149662&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/vararg-non-pod.mm (original)
+++ cfe/trunk/test/SemaObjCXX/vararg-non-pod.mm Thu Feb 2 19:49:51 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -Wnon-pod-varargs
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs
extern char version[];
More information about the cfe-commits
mailing list