summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp b/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
index f89caf7..7cf7305 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
@@ -226,12 +226,12 @@ void DiagnosticsEngine::setSeverity(diag::kind Diag, diag::Severity Map,
// Update all diagnostic states that are active after the given location.
for (DiagStatePointsTy::iterator
I = Pos+1, E = DiagStatePoints.end(); I != E; ++I) {
- GetCurDiagState()->setMapping(Diag, Mapping);
+ I->State->setMapping(Diag, Mapping);
}
// If the location corresponds to an existing point, just update its state.
if (Pos->Loc == Loc) {
- GetCurDiagState()->setMapping(Diag, Mapping);
+ Pos->State->setMapping(Diag, Mapping);
return;
}
@@ -240,7 +240,7 @@ void DiagnosticsEngine::setSeverity(diag::kind Diag, diag::Severity Map,
assert(Pos->Loc.isBeforeInTranslationUnitThan(Loc));
DiagStates.push_back(*Pos->State);
DiagState *NewState = &DiagStates.back();
- GetCurDiagState()->setMapping(Diag, Mapping);
+ NewState->setMapping(Diag, Mapping);
DiagStatePoints.insert(Pos+1, DiagStatePoint(NewState,
FullSourceLoc(Loc, *SourceMgr)));
}
@@ -278,8 +278,8 @@ bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group,
return true;
// Perform the mapping change.
- for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
- DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
+ for (diag::kind Diag : GroupDiags) {
+ DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(Diag);
if (Info.getSeverity() == diag::Severity::Error ||
Info.getSeverity() == diag::Severity::Fatal)
@@ -309,8 +309,8 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group,
return true;
// Perform the mapping change.
- for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
- DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
+ for (diag::kind Diag : GroupDiags) {
+ DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(Diag);
if (Info.getSeverity() == diag::Severity::Fatal)
Info.setSeverity(diag::Severity::Error);
@@ -329,9 +329,9 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
Diags->getAllDiagnostics(Flavor, AllDiags);
// Set the mapping.
- for (unsigned i = 0, e = AllDiags.size(); i != e; ++i)
- if (Diags->isBuiltinWarningOrExtension(AllDiags[i]))
- setSeverity(AllDiags[i], Map, Loc);
+ for (diag::kind Diag : AllDiags)
+ if (Diags->isBuiltinWarningOrExtension(Diag))
+ setSeverity(Diag, Map, Loc);
}
void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
@@ -945,8 +945,6 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
OutStr.append(Tree.begin(), Tree.end());
}
-StoredDiagnostic::StoredDiagnostic() { }
-
StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message)
: ID(ID), Level(Level), Loc(), Message(Message) { }
@@ -975,8 +973,6 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
{
}
-StoredDiagnostic::~StoredDiagnostic() { }
-
/// IncludeInDiagnosticCounts - This method (whose default implementation
/// returns true) indicates whether the diagnostics handled by this
/// DiagnosticConsumer should be included in the number of diagnostics
OpenPOWER on IntegriCloud