The LanguageType enums are used as indexes into array language_names and g_languages in LanguageRuntime::GetNameForLanguageType, Language::SetLanguageFromCString and Language::AsCString. This patch fixes the enum LanguageType values and language string table lookups for user defined languages (with DWARF values above DW_LANG_lo_user = 0x8000), by using a conversion routine to convert the DWARF value to it's corresponding LanguageType enum.
Details:
- Fix enum LanguageType values so that they can be used as indexes.
- Add DWARFCompileUnit::LanguageTypeFromDWARF to convert from DWARF DW_LANG_* values to enum LanguageType values.
Note: Support for the RenderScript was added in svn commit 234002, but I don't see how it could have ever worked, since the LanguageType values are used as indexes into string tables. The DWARF value was hardcoded as part of this fix since it doesn't exist in llvm.