Index: tools/clang/include/clang/Basic/Diagnostic.h
==================================================================
--- tools/clang/include/clang/Basic/Diagnostic.h
+++ tools/clang/include/clang/Basic/Diagnostic.h
@@ -762,10 +762,14 @@
   // Sema::Diag() patterns.
   friend class Sema;
 
   /// \brief Emit the current diagnostic and clear the diagnostic state.
   bool EmitCurrentDiagnostic();
+
+  /// \brief Force the current diagnostic to be emitted, overriding any active
+  /// suppression settings, and clear the diagnostic state.
+  bool ForceEmitCurrentDiagnostic();
 
   unsigned getCurrentDiagID() const { return CurDiagID; }
 
   SourceLocation getCurrentDiagLoc() const { return CurDiagLoc; }
 
@@ -830,19 +834,25 @@
   ///
   // NOTE: This field is redundant with DiagObj (IsActive iff (DiagObj == 0)),
   // but LLVM is not currently smart enough to eliminate the null check that
   // Emit() would end up with if we used that as our status variable.
   mutable bool IsActive;
+
+  /// \brief Flag indicating that this diagnostic is being emitted via a
+  /// call to ForceEmit.
+  mutable bool IsForceEmit;
 
   void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT
   friend class DiagnosticsEngine;
   
   DiagnosticBuilder()
-    : DiagObj(0), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(false) { }
+    : DiagObj(0), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(false),
+      IsForceEmit(false) { }
 
   explicit DiagnosticBuilder(DiagnosticsEngine *diagObj)
-    : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(true) {
+    : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(true),
+      IsForceEmit(false) {
     assert(diagObj && "DiagnosticBuilder requires a valid DiagnosticsEngine!");
   }
 
   friend class PartialDiagnostic;
   
@@ -855,10 +865,11 @@
 
   /// \brief Clear out the current diagnostic.
   void Clear() const {
     DiagObj = 0;
     IsActive = false;
+    IsForceEmit = false;
   }
 
   /// \brief Determine whether this diagnostic is still active.
   bool isActive() const { return IsActive; }
 
@@ -877,11 +888,13 @@
     // When emitting diagnostics, we set the final argument count into
     // the DiagnosticsEngine object.
     FlushCounts();
 
     // Process the diagnostic.
-    bool Result = DiagObj->EmitCurrentDiagnostic();
+    bool Result = IsForceEmit
+                    ? DiagObj->ForceEmitCurrentDiagnostic()
+                    : DiagObj->EmitCurrentDiagnostic();
 
     // This diagnostic is dead.
     Clear();
 
     return Result;
@@ -891,10 +904,11 @@
   /// Copy constructor.  When copied, this "takes" the diagnostic info from the
   /// input and neuters it.
   DiagnosticBuilder(const DiagnosticBuilder &D) {
     DiagObj = D.DiagObj;
     IsActive = D.IsActive;
+    IsForceEmit = D.IsForceEmit;
     D.Clear();
     NumArgs = D.NumArgs;
     NumRanges = D.NumRanges;
     NumFixits = D.NumFixits;
   }
@@ -907,10 +921,16 @@
   /// \brief Emits the diagnostic.
   ~DiagnosticBuilder() {
     Emit();
   }
   
+  /// \brief Forces the diagnostic to be emitted.
+  const DiagnosticBuilder &setForceEmit() const {
+    IsForceEmit = true;
+    return *this;
+  }
+
   /// \brief Conversion of DiagnosticBuilder to bool always returns \c true.
   ///
   /// This allows is to be used in boolean error contexts (where \c true is
   /// used to indicate that an error has occurred), like:
   /// \code

Index: tools/clang/include/clang/Basic/DiagnosticIDs.h
==================================================================
--- tools/clang/include/clang/Basic/DiagnosticIDs.h
+++ tools/clang/include/clang/Basic/DiagnosticIDs.h
@@ -265,10 +265,14 @@
   /// \brief Used to report a diagnostic that is finally fully formed.
   ///
   /// \returns \c true if the diagnostic was emitted, \c false if it was
   /// suppressed.
   bool ProcessDiag(DiagnosticsEngine &Diag) const;
+
+  /// \brief Used to emit a diagnostic that is finally fully formed,
+  /// ignoring suppression.
+  void EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const;
 
   /// \brief Whether the diagnostic may leave the AST in a state where some
   /// invariants can break.
   bool isUnrecoverable(unsigned DiagID) const;
 

Index: tools/clang/lib/Basic/Diagnostic.cpp
==================================================================
--- tools/clang/lib/Basic/Diagnostic.cpp
+++ tools/clang/lib/Basic/Diagnostic.cpp
@@ -396,10 +396,29 @@
     ReportDelayed();
 
   return Emitted;
 }
 
+bool DiagnosticsEngine::ForceEmitCurrentDiagnostic() {
+  Diagnostic Info(this);
+  assert(getClient() && "DiagnosticClient not set!");
+
+  // Figure out the diagnostic level of this message.
+  DiagnosticIDs::Level DiagLevel
+    = Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);
+
+  if (DiagLevel == DiagnosticIDs::Ignored)
+    return false;
+
+  // Emit the diagnostic regardless of suppression level.
+  Diags->EmitDiag(*this, DiagLevel);
+
+  // Clear out the current diagnostic object.
+  Clear();
+
+  return true;
+}
 
 DiagnosticConsumer::~DiagnosticConsumer() {}
 
 void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
                                         const Diagnostic &Info) {

Index: tools/clang/lib/Basic/DiagnosticIDs.cpp
==================================================================
--- tools/clang/lib/Basic/DiagnosticIDs.cpp
+++ tools/clang/lib/Basic/DiagnosticIDs.cpp
@@ -355,11 +355,11 @@
   // Handle custom diagnostics, which cannot be mapped.
   if (DiagID >= diag::DIAG_UPPER_LIMIT)
     return CustomDiagInfo->getLevel(DiagID);
 
   unsigned DiagClass = getBuiltinDiagClass(DiagID);
-  assert(DiagClass != CLASS_NOTE && "Cannot get diagnostic level of a note!");
+  if (DiagClass == CLASS_NOTE) return DiagnosticIDs::Note;
   return getDiagnosticLevel(DiagID, DiagClass, Loc, Diag);
 }
 
 /// \brief Based on the way the client configured the Diagnostic
 /// object, classify the specified diagnostic ID into a Level, consumable by
@@ -581,28 +581,13 @@
     return false;
 
   assert(Diag.getClient() && "DiagnosticClient not set!");
 
   // Figure out the diagnostic level of this message.
-  DiagnosticIDs::Level DiagLevel;
   unsigned DiagID = Info.getID();
-
-  if (DiagID >= diag::DIAG_UPPER_LIMIT) {
-    // Handle custom diagnostics, which cannot be mapped.
-    DiagLevel = CustomDiagInfo->getLevel(DiagID);
-  } else {
-    // Get the class of the diagnostic.  If this is a NOTE, map it onto whatever
-    // the diagnostic level was for the previous diagnostic so that it is
-    // filtered the same as the previous diagnostic.
-    unsigned DiagClass = getBuiltinDiagClass(DiagID);
-    if (DiagClass == CLASS_NOTE) {
-      DiagLevel = DiagnosticIDs::Note;
-    } else {
-      DiagLevel = getDiagnosticLevel(DiagID, DiagClass, Info.getLocation(),
-                                     Diag);
-    }
-  }
+  DiagnosticIDs::Level DiagLevel
+    = getDiagnosticLevel(DiagID, Info.getLocation(), Diag);
 
   if (DiagLevel != DiagnosticIDs::Note) {
     // Record that a fatal error occurred only when we see a second
     // non-note diagnostic. This allows notes to be attached to the
     // fatal error, but suppresses any diagnostics that follow those
@@ -656,19 +641,25 @@
       return false;
     }
   }
 
   // Finally, report it.
+  EmitDiag(Diag, DiagLevel);
+  return true;
+}
+
+void DiagnosticIDs::EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const {
+  Diagnostic Info(&Diag);
+  assert(DiagLevel != DiagnosticIDs::Ignored && "Cannot emit ignored diagnostics!");
+
   Diag.Client->HandleDiagnostic((DiagnosticsEngine::Level)DiagLevel, Info);
   if (Diag.Client->IncludeInDiagnosticCounts()) {
     if (DiagLevel == DiagnosticIDs::Warning)
       ++Diag.NumWarnings;
   }
 
   Diag.CurDiagID = ~0U;
-
-  return true;
 }
 
 bool DiagnosticIDs::isUnrecoverable(unsigned DiagID) const {
   if (DiagID >= diag::DIAG_UPPER_LIMIT) {
     // Custom diagnostics.

Index: tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
==================================================================
--- tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -388,11 +388,11 @@
     else
       OS << "\n  Line " << SourceMgr->getPresumedLineNumber(I->first);
     OS << ": " << I->second;
   }
 
-  Diags.Report(diag::err_verify_inconsistent_diags)
+  Diags.Report(diag::err_verify_inconsistent_diags).setForceEmit()
     << Kind << !Expected << OS.str();
   return std::distance(diag_begin, diag_end);
 }
 
 static unsigned PrintProblem(DiagnosticsEngine &Diags, SourceManager *SourceMgr,
@@ -414,11 +414,11 @@
          << SourceMgr->getFilename(D.DirectiveLoc) << ":"
          << SourceMgr->getPresumedLineNumber(D.DirectiveLoc) << ")";
     OS << ": " << D.Text;
   }
 
-  Diags.Report(diag::err_verify_inconsistent_diags)
+  Diags.Report(diag::err_verify_inconsistent_diags).setForceEmit()
     << Kind << !Expected << OS.str();
   return DL.size();
 }
 
 /// CheckLists - Compare expected to seen diagnostic lists and return the

