================
@@ -976,6 +976,40 @@ void CodeGenModule::Release() {
       Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity();
   getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth);
 
+  if (getTriple().isOSzOS()) {
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Major Version",
+                              uint32_t(CLANG_VERSION_MAJOR));
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Minor Version",
+                              uint32_t(CLANG_VERSION_MINOR));
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Patchlevel",
+                              uint32_t(CLANG_VERSION_PATCHLEVEL));
+
+    // Record the language because we need it for the PPA2.
+    StringRef lang_str = languageToString(
+        LangStandard::getLangStandardForKind(LangOpts.LangStd).Language);
+    getModule().addModuleFlag(llvm::Module::Error, "zos_cu_language",
+                              llvm::MDString::get(VMContext, lang_str));
+
+    std::string ProductId;
+#ifdef CLANG_VENDOR
+    ProductId = #CLANG_VENDOR;
+#else
+    ProductId = "clang";
+#endif
+
+    getModule().addModuleFlag(llvm::Module::Error, "Product Id",
+                              llvm::MDString::get(VMContext, ProductId));
+
+    getModule().addModuleFlag(llvm::Module::Error, "TranslationTime",
----------------
uweigand wrote:

I don't think `Error` is the correct setting for this.  That would prevent LTO 
unless modules were built at the exact same time.  Rather, I think this should 
be `Max` here.

https://github.com/llvm/llvm-project/pull/68926
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to