[llvm] [llvm-nm][z/OS] Display archive attributes in GOFF archives through --print-armap (PR #212830)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 10:47:38 PDT 2026
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 origin/main HEAD --extensions cpp,h -- llvm/include/llvm/Object/Archive.h llvm/lib/Object/Archive.cpp llvm/tools/llvm-nm/llvm-nm.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Object/Archive.h b/llvm/include/llvm/Object/Archive.h
index d574b3817..442f61ae3 100644
--- a/llvm/include/llvm/Object/Archive.h
+++ b/llvm/include/llvm/Object/Archive.h
@@ -349,9 +349,9 @@ public:
LLVM_ABI Symbol getNext() const;
LLVM_ABI bool isECSymbol() const;
/// Archive attribute bit masks for K_ZOS archive symbol table entries.
- static constexpr uint32_t ZOSAttrWSA = 0x1;
- static constexpr uint32_t ZOSAttrXPLink = 0x2;
- static constexpr uint32_t ZOSAttr64Bit = 0x4;
+ static constexpr uint32_t ZOSAttrWSA = 0x1;
+ static constexpr uint32_t ZOSAttrXPLink = 0x2;
+ static constexpr uint32_t ZOSAttr64Bit = 0x4;
static constexpr uint32_t ZOSKnownAttrMask =
ZOSAttrWSA | ZOSAttrXPLink | ZOSAttr64Bit;
/// For K_ZOS archives, returns the 32-bit attribute word stored alongside
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index 2584fedaf..0a178d76e 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -2052,7 +2052,7 @@ static std::string decodeZOSAttributes(uint32_t Attrs) {
bool Unknown = (Attrs & ~Archive::Symbol::ZOSKnownAttrMask) != 0;
bool Is64Bit = (Attrs & Archive::Symbol::ZOSAttr64Bit) != 0;
bool IsXPLink = (Attrs & Archive::Symbol::ZOSAttrXPLink) != 0;
- bool IsWSA = (Attrs & Archive::Symbol::ZOSAttrWSA) != 0;
+ bool IsWSA = (Attrs & Archive::Symbol::ZOSAttrWSA) != 0;
std::string Result = "[";
bool NeedPlus = false;
@@ -2062,11 +2062,16 @@ static std::string decodeZOSAttributes(uint32_t Attrs) {
Result += S;
NeedPlus = true;
};
- if (Is64Bit) append("64-bit");
- if (IsXPLink) append("XPLink");
- if (IsWSA) append("WSA");
- if (Unknown) append("?");
- if (!NeedPlus) append("none");
+ if (Is64Bit)
+ append("64-bit");
+ if (IsXPLink)
+ append("XPLink");
+ if (IsWSA)
+ append("WSA");
+ if (Unknown)
+ append("?");
+ if (!NeedPlus)
+ append("none");
Result += "]";
return Result;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/212830
More information about the llvm-commits
mailing list