include the default mapping in the clang diagnostic .inc files.

llvm-svn: 69173
This commit is contained in:
Chris Lattner 2009-04-15 16:43:18 +00:00
parent 03d5a78eca
commit 9e2f6e304c

View File

@ -69,20 +69,15 @@ static void EmitAllCaps(std::ostream& OS, const std::string &s) {
static void ProcessDiag(std::ostream &OS, const Record *DiagClass,
const Record &R) {
const Record* DiagKind = getDiagKind(DiagClass, R);
if (!DiagKind)
return;
OS << "DIAG(" << R.getName() << ", ";
EmitAllCaps(OS, DiagKind->getName());
const RecordVal* Text = findRecordVal(R, "Text");
assert(Text && "No 'Text' entry in Diagnostic.");
const StringInit* TextVal = dynamic_cast<const StringInit*>(Text->getValue());
assert(TextVal && "Value 'Text' must be a string.");
OS << ", diag::" << R.getValueAsDef("DefaultMapping")->getName();
OS << ", \"";
EmitEscaped(OS, TextVal->getValue());
EmitEscaped(OS, R.getValueAsString("Text"));
OS << "\")\n";
}