@@ -977,21 +977,34 @@ void CodeGenModule::Release() {
977
977
getModule ().addModuleFlag (llvm::Module::Error, " wchar_size" , WCharWidth);
978
978
979
979
if (getTriple ().isOSzOS ()) {
980
- int32_t ProductVersion, ProductRelease, ProductPatch;
981
- ProductVersion = LLVM_VERSION_MAJOR, ProductRelease = LLVM_VERSION_MINOR,
982
- ProductPatch = LLVM_VERSION_PATCH;
983
980
getModule ().addModuleFlag (llvm::Module::Warning, " Product Major Version" ,
984
- ProductVersion );
981
+ uint32_t (CLANG_VERSION_MAJOR) );
985
982
getModule ().addModuleFlag (llvm::Module::Warning, " Product Minor Version" ,
986
- ProductRelease );
983
+ uint32_t (CLANG_VERSION_MINOR) );
987
984
getModule ().addModuleFlag (llvm::Module::Warning, " Product Patchlevel" ,
988
- ProductPatch );
985
+ uint32_t (CLANG_VERSION_PATCHLEVEL) );
989
986
990
987
// Record the language because we need it for the PPA2.
991
988
const char *lang_str = languageToString (
992
989
LangStandard::getLangStandardForKind (LangOpts.LangStd ).Language );
993
990
getModule ().addModuleFlag (llvm::Module::Error, " zos_cu_language" ,
994
991
llvm::MDString::get (VMContext, lang_str));
992
+
993
+ std::string ProductId;
994
+ #ifdef CLANG_VENDOR
995
+ ProductId = #CLANG_VENDOR;
996
+ #else
997
+ ProductId = " clang" ;
998
+ #endif
999
+
1000
+ getModule ().addModuleFlag (llvm::Module::Error, " Product Id" ,
1001
+ llvm::MDString::get (VMContext, ProductId));
1002
+
1003
+ getModule ().addModuleFlag (
1004
+ llvm::Module::Error, " zos_le_char_mode" ,
1005
+ llvm::MDString::get (VMContext, Context.getLangOpts ().ASCIICharMode
1006
+ ? " ascii"
1007
+ : " ebcdic" ));
995
1008
}
996
1009
997
1010
llvm::Triple::ArchType Arch = Context.getTargetInfo ().getTriple ().getArch ();
0 commit comments