Index: utils/TableGen/ClangDiagnosticsEmitter.cpp
===================================================================
--- utils/TableGen/ClangDiagnosticsEmitter.cpp	(revision 128343)
+++ utils/TableGen/ClangDiagnosticsEmitter.cpp	(copie de travail)
@@ -120,6 +120,27 @@
   };
 } // end anonymous namespace.
 
+/// getPrintableName - extract the name from the id for printing in diagnostics
+/// (remove the fatal_, err_, ext_, warn_, note_ ... prefix)
+static const char* getPrintableName(const char* id) {
+  assert(strlen(id) >= 6 && "Too short id");
+  if (strncmp(id, "fatal_", 6) == 0) {
+    return id + 6;
+  }
+  if (strncmp(id, "err_", 4) == 0) {
+    return id + 4;
+  }
+  if (strncmp(id, "ext_", 4) == 0) {
+    return id + 4;
+  }
+  if (strncmp(id, "warn_", 5) == 0) {
+    return id + 5;
+  }
+  if (strncmp(id, "note_", 5) == 0) {
+    return id + 5;
+  }
+  return id;
+}
 
 
 //===----------------------------------------------------------------------===//
@@ -149,7 +170,10 @@
     if (!Component.empty() && Component != R.getValueAsString("Component"))
       continue;
     
-    OS << "DIAG(" << R.getName() << ", ";
+    std::string const Name = R.getName();
+    
+    OS << "DIAG(" << Name << ", \"";
+    OS << getPrintableName(Name.c_str()) << "\", ";
     OS << R.getValueAsDef("Class")->getName();
     OS << ", diag::" << R.getValueAsDef("DefaultMapping")->getName();
     
@@ -179,6 +203,14 @@
 
     // Category number.
     OS << ", " << CategoryIDs.getID(getDiagnosticCategory(&R, DGParentMap));
+
+    // Brief
+    OS << ", \"";
+    OS.write_escaped(R.getValueAsString("Brief")) << '"';
+
+    // Explanation 
+    OS << ", \"";
+    OS.write_escaped(R.getValueAsString("Explanation")) << '"';
     OS << ")\n";
   }
 }
