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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69173 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-04-15 16:43:18 +00:00
parent f1624aa4dc
commit 5b66c04f33

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";
}