llvmc: Allow multiple LanguageMaps.

llvm-svn: 111829
This commit is contained in:
Mikhail Glushenkov 2010-08-23 19:24:16 +00:00
parent c6c79ddcb9
commit 1a90528e63
1 changed files with 5 additions and 5 deletions

View File

@ -2621,12 +2621,12 @@ void EmitPopulateLanguageMap (const RecordKeeper& Records, raw_ostream& O)
{
O << "int PopulateLanguageMap (LanguageMap& langMap) {\n";
// Get the relevant field out of RecordKeeper
// TODO: change this to getAllDerivedDefinitions.
const Record* LangMapRecord = Records.getDef("LanguageMap");
const RecordVector& LanguageMaps =
Records.getAllDerivedDefinitions("LanguageMap");
if (LangMapRecord) {
ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map");
for (RecordVector::const_iterator B = LanguageMaps.begin(),
E = LanguageMaps.end(); B!=E; ++B) {
ListInit* LangsToSuffixesList = (*B)->getValueAsListInit("map");
if (!LangsToSuffixesList)
throw "Error in the language map definition!";