@@ -5876,6 +5876,7 @@ bool LLParser::parseDICompileUnit(MDNode *&Result, bool IsDistinct) {
58765876 REQUIRED (file, MDField, (/* AllowNull */ false )); \
58775877 OPTIONAL (language, DwarfLangField, ); \
58785878 OPTIONAL (sourceLanguageName, DwarfSourceLangNameField, ); \
5879+ OPTIONAL (sourceLanguageVersion, MDUnsignedField, (0 , UINT32_MAX)); \
58795880 OPTIONAL (producer, MDStringField, ); \
58805881 OPTIONAL (isOptimized, MDBoolField, ); \
58815882 OPTIONAL (flags, MDStringField, ); \
@@ -5905,10 +5906,15 @@ bool LLParser::parseDICompileUnit(MDNode *&Result, bool IsDistinct) {
59055906 return error (Loc, " can only specify one of 'language' and "
59065907 " 'sourceLanguageName' on !DICompileUnit" );
59075908
5909+ if (sourceLanguageVersion.Seen && !sourceLanguageName.Seen )
5910+ return error (Loc, " 'sourceLanguageVersion' requires an associated "
5911+ " 'sourceLanguageName' on !DICompileUnit" );
5912+
59085913 Result = DICompileUnit::getDistinct (
59095914 Context,
59105915 language.Seen ? DISourceLanguageName (language.Val )
5911- : DISourceLanguageName (sourceLanguageName.Val , 0 ),
5916+ : DISourceLanguageName (sourceLanguageName.Val ,
5917+ sourceLanguageVersion.Val ),
59125918 file.Val , producer.Val , isOptimized.Val , flags.Val , runtimeVersion.Val ,
59135919 splitDebugFilename.Val , emissionKind.Val , enums.Val , retainedTypes.Val ,
59145920 globals.Val , imports.Val , macros.Val , dwoId.Val , splitDebugInlining.Val ,
0 commit comments