================ @@ -976,6 +976,46 @@ void CodeGenModule::Release() { Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth); + if (getTriple().isOSzOS()) { + getModule().addModuleFlag(llvm::Module::Warning, + "zos_product_major_version", + uint32_t(CLANG_VERSION_MAJOR)); + getModule().addModuleFlag(llvm::Module::Warning, + "zos_product_minor_version", + uint32_t(CLANG_VERSION_MINOR)); + getModule().addModuleFlag(llvm::Module::Warning, "zos_product_patchlevel", + uint32_t(CLANG_VERSION_PATCHLEVEL)); + std::string ProductId; +#ifdef CLANG_VENDOR + ProductId = #CLANG_VENDOR; +#else + ProductId = "clang"; +#endif + // Remove - from Product Id, which makes it consistent with legacy. + std::size_t DashFound = ProductId.find("-"); + if (DashFound != std::string::npos) + ProductId.erase(ProductId.begin() + DashFound); ---------------- uweigand wrote:
Now that this code is moved here, it could only make a difference when compiling clang with a `CLANG_VENDOR` containing a dash. If that is a problem for your use case, then why not simply build with the desired `CLANG_VENDOR` to begin with? It's a bit unclear to me which general problem this code solves at this place now. 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