[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 12 14:11:53 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 2ae3a712304870adf639a33547c1139a7b6304e5 5ea8bea2bdf345e2baee07e0a94ac40bd0f109c4 -- clang/test/CodeGen/SystemZ/systemz-ppa2.c clang/include/clang/Basic/LangStandard.h clang/lib/Basic/LangStandards.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Driver/ToolChains/Clang.h llvm/include/llvm/BinaryFormat/GOFF.h llvm/include/llvm/MC/MCObjectFileInfo.h llvm/lib/MC/MCObjectFileInfo.cpp llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp llvm/lib/Target/SystemZ/SystemZAsmPrinter.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Basic/LangStandards.cpp b/clang/lib/Basic/LangStandards.cpp
index e9b75d78e820..dea2126ba93b 100644
--- a/clang/lib/Basic/LangStandards.cpp
+++ b/clang/lib/Basic/LangStandards.cpp
@@ -48,7 +48,8 @@ const char *clang::LanguageToString(Language L) {
     return "HLSL";
   }
 
-  std::string msg = llvm::formatv("Unknown value ({0}) passed to LanguageToString", (unsigned int) L);
+  std::string msg = llvm::formatv(
+      "Unknown value ({0}) passed to LanguageToString", (unsigned int)L);
   llvm_unreachable(msg.c_str());
 }
 
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 4fd5f8ad2d94..65327df218e6 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -978,11 +978,14 @@ void CodeGenModule::Release() {
 
   if (getTriple().isOSzOS()) {
     int32_t ProductVersion, ProductRelease, ProductPatch;
-    ProductVersion = LLVM_VERSION_MAJOR,
-    ProductRelease = LLVM_VERSION_MINOR, ProductPatch = LLVM_VERSION_PATCH;
-    getModule().addModuleFlag(llvm::Module::Warning, "Product Major Version", ProductVersion);
-    getModule().addModuleFlag(llvm::Module::Warning, "Product Minor Version", ProductRelease);
-    getModule().addModuleFlag(llvm::Module::Warning, "Product Patchlevel", ProductPatch);
+    ProductVersion = LLVM_VERSION_MAJOR, ProductRelease = LLVM_VERSION_MINOR,
+    ProductPatch = LLVM_VERSION_PATCH;
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Major Version",
+                              ProductVersion);
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Minor Version",
+                              ProductRelease);
+    getModule().addModuleFlag(llvm::Module::Warning, "Product Patchlevel",
+                              ProductPatch);
 
     // Record the language because we need it for the PPA2.
     const char *lang_str = LanguageToString(
diff --git a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
index d963009c6c15..9d1a8d103e34 100644
--- a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
@@ -30,7 +30,6 @@
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConvertEBCDIC.h"
-#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FormatProviders.h"
 #include "llvm/Support/FormatVariadic.h"
 
@@ -1092,8 +1091,8 @@ void SystemZAsmPrinter::emitIDRLSection(Module &M) {
 
   ConverterEBCDIC::convertToEBCDIC(TempStr, Data);
 
-  OutStreamer->emitInt8(0);   // Reserved.
-  OutStreamer->emitInt8(3);   // Format.
+  OutStreamer->emitInt8(0);               // Reserved.
+  OutStreamer->emitInt8(3);               // Format.
   OutStreamer->emitInt16(IDRLDataLength); // Length.
   OutStreamer->emitBytes(Data.str());
   OutStreamer->popSection();
@@ -1402,8 +1401,8 @@ void SystemZAsmPrinter::emitPPA2(Module &M) {
 
   SmallString<7> Version; // 6 + null
   raw_svector_ostream ostr(Version);
-  ostr << formatv("{0,0-2:d}{1,0-2:d}{2,0-2:d}", ProductVersion,
-                  ProductRelease, ProductPatch);
+  ostr << formatv("{0,0-2:d}{1,0-2:d}{2,0-2:d}", ProductVersion, ProductRelease,
+                  ProductPatch);
 
   // Drop 0 during conversion.
   SmallString<sizeof(CompilationTime) - 1> CompilationTimeStr;

``````````

</details>


https://github.com/llvm/llvm-project/pull/68926


More information about the cfe-commits mailing list