[llvm] [LLVM] Maintain element type of @llvm.compiler.used/@llvm.used if it already exists (PR #162660)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 01:17:40 PDT 2025


Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162660 at github.com>


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 -- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/lib/Transforms/Utils/ModuleUtils.cpp llvm/unittests/Transforms/Utils/ModuleUtilsTest.cpp
``````````

: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/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index a6519ad7f..d6f491f5a 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -5849,9 +5849,7 @@ static const char *getSectionNameForCommandline(const Triple &T) {
 }
 
 static auto globalInUsedHasName(StringRef Name) {
-  return [Name](Constant* C) {
-    return C->getName() == Name;
-  };
+  return [Name](Constant *C) { return C->getName() == Name; };
 }
 
 void llvm::embedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,

``````````

</details>


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


More information about the llvm-commits mailing list