[llvm] [MergeFuncs] Don't introduce calls to weak_odr functions. (PR #125050)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 08:10:03 PST 2025


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 2bde7a1b7c777ae0f0303af9634dd6e4a98cab00 ad402537682a67e74bf508c8032b653a6d9579ca --extensions cpp -- llvm/lib/Transforms/IPO/MergeFunctions.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index ea5e102156..7130e8ce04 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -891,8 +891,10 @@ bool MergeFunctions::writeThunkOrAlias(Function *F, Function *G) {
 
 // Merge two equivalent functions. Upon completion, Function G is deleted.
 void MergeFunctions::mergeTwoFunctions(Function *F, Function *G) {
-  if (F->isInterposable() || G->hasWeakODRLinkage() || G->hasLinkOnceODRLinkage()) {
-    assert(G->isInterposable() || G->hasWeakODRLinkage()|| G->hasLinkOnceODRLinkage());
+  if (F->isInterposable() || G->hasWeakODRLinkage() ||
+      G->hasLinkOnceODRLinkage()) {
+    assert(G->isInterposable() || G->hasWeakODRLinkage() ||
+           G->hasLinkOnceODRLinkage());
 
     // Both writeThunkOrAlias() calls below must succeed, either because we can
     // create aliases for G and NewF, or because a thunk for F is profitable.

``````````

</details>


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


More information about the llvm-commits mailing list