================ @@ -1026,6 +1036,68 @@ void SystemZAsmPrinter::emitADASection() { OutStreamer->popSection(); } +static uint32_t getProductVersion(Module &M) { + if (auto *VersionVal = cast_or_null<ConstantAsMetadata>( + M.getModuleFlag("Product Major Version"))) + return cast<ConstantInt>(VersionVal->getValue())->getZExtValue(); + return LLVM_VERSION_MAJOR; +} + +static uint32_t getProductRelease(Module &M) { + if (auto *ReleaseVal = cast_or_null<ConstantAsMetadata>( + M.getModuleFlag("Product Minor Version"))) + return cast<ConstantInt>(ReleaseVal->getValue())->getZExtValue(); + return LLVM_VERSION_MINOR; +} + +static uint32_t getProductPatch(Module &M) { + if (auto *PatchVal = cast_or_null<ConstantAsMetadata>( + M.getModuleFlag("Product Patchlevel"))) + return cast<ConstantInt>(PatchVal->getValue())->getZExtValue(); + return LLVM_VERSION_PATCH; +} + +void SystemZAsmPrinter::emitIDRLSection(Module &M) { + OutStreamer->pushSection(); + OutStreamer->switchSection(getObjFileLowering().getIDRLSection()); + constexpr unsigned IDRLDataLength = 30; + std::time_t Time = TranslationTime; + + uint32_t ProductVersion = getProductVersion(M); + uint32_t ProductRelease = getProductRelease(M); + + std::string ProductID; + if (auto *MD = M.getModuleFlag("Product Id")) ---------------- ysyeda wrote:
This is now set in clang. 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