summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-10 06:09:00 +0000
committerAlp Toker <alp@nuanti.com>2014-06-10 06:09:00 +0000
commited2c033b9beed8448945e340195ec426ef73ffdd (patch)
treeb9a87f9704979eee8c196555deb5329c26815243 /clang/lib/Basic
parent4f43e554081ecac149fe360bee6eef2ed7dab8ea (diff)
downloadbcm5719-llvm-ed2c033b9beed8448945e340195ec426ef73ffdd.tar.gz
bcm5719-llvm-ed2c033b9beed8448945e340195ec426ef73ffdd.zip
Show -Wdate-time in system headers
Anyone enabling this warning would expect to hear about all occurrences including those in system headers that can cause non-reproducible builds. To achieve this, rework ShowInSystemHeader to remove broken unused mapping code that didn't make sense with a simpler and correct scheme. llvm-svn: 210512
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 47798596ccd..7c8fe365f5b 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -164,12 +164,6 @@ static DiagnosticMappingInfo GetDefaultDiagMappingInfo(unsigned DiagID) {
"Unexpected mapping with no-Werror bit!");
Info.setNoWarningAsError(true);
}
-
- if (StaticInfo->WarnShowInSystemHeader) {
- assert(Info.getMapping() == diag::MAP_WARNING &&
- "Unexpected mapping with show-in-system-header bit!");
- Info.setShowInSystemHeader(true);
- }
}
return Info;
@@ -486,16 +480,15 @@ DiagnosticIDs::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass,
Result = DiagnosticIDs::Fatal;
}
+ // Custom diagnostics always are emitted in system headers.
+ bool ShowInSystemHeader =
+ !GetDiagInfo(DiagID) || GetDiagInfo(DiagID)->WarnShowInSystemHeader;
+
// If we are in a system header, we ignore it. We look at the diagnostic class
// because we also want to ignore extensions and warnings in -Werror and
// -pedantic-errors modes, which *map* warnings/extensions to errors.
- if (Result >= DiagnosticIDs::Warning &&
- DiagClass != CLASS_ERROR &&
- // Custom diagnostics always are emitted in system headers.
- DiagID < diag::DIAG_UPPER_LIMIT &&
- !MappingInfo.hasShowInSystemHeader() &&
- Diag.SuppressSystemWarnings &&
- Loc.isValid() &&
+ if (Result >= DiagnosticIDs::Warning && DiagClass != CLASS_ERROR &&
+ !ShowInSystemHeader && Diag.SuppressSystemWarnings && Loc.isValid() &&
Diag.getSourceManager().isInSystemHeader(
Diag.getSourceManager().getExpansionLoc(Loc)))
return DiagnosticIDs::Ignored;
OpenPOWER on IntegriCloud