@@ -5865,6 +5865,7 @@ bool LLParser::parseDICompileUnit(MDNode *&Result, bool IsDistinct) {
58655865 REQUIRED (file, MDField, (/* AllowNull */ false )); \
58665866 OPTIONAL (language, DwarfLangField, ); \
58675867 OPTIONAL (sourceLanguageName, DwarfSourceLangNameField, ); \
5868+ OPTIONAL (sourceLanguageVersion, MDUnsignedField, (0 , UINT32_MAX)); \
58685869 OPTIONAL (producer, MDStringField, ); \
58695870 OPTIONAL (isOptimized, MDBoolField, ); \
58705871 OPTIONAL (flags, MDStringField, ); \
@@ -5894,10 +5895,15 @@ bool LLParser::parseDICompileUnit(MDNode *&Result, bool IsDistinct) {
58945895 return error (Loc, " can only specify one of 'language' and "
58955896 " 'sourceLanguageName' on !DICompileUnit" );
58965897
5898+ if (sourceLanguageVersion.Seen && !sourceLanguageName.Seen )
5899+ return error (Loc, " 'sourceLanguageVersion' requires an associated "
5900+ " 'sourceLanguageName' on !DICompileUnit" );
5901+
58975902 Result = DICompileUnit::getDistinct (
58985903 Context,
58995904 language.Seen ? DISourceLanguageName (language.Val )
5900- : DISourceLanguageName (sourceLanguageName.Val , 0 ),
5905+ : DISourceLanguageName (sourceLanguageName.Val ,
5906+ sourceLanguageVersion.Val ),
59015907 file.Val , producer.Val , isOptimized.Val , flags.Val , runtimeVersion.Val ,
59025908 splitDebugFilename.Val , emissionKind.Val , enums.Val , retainedTypes.Val ,
59035909 globals.Val , imports.Val , macros.Val , dwoId.Val , splitDebugInlining.Val ,
0 commit comments