llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Artem Belevich (Artem-B)

<details>
<summary>Changes</summary>

Fixes https://github.com/llvm/llvm-project/issues/101560

---
Full diff: https://github.com/llvm/llvm-project/pull/102661.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenModule.cpp (+3) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 9aaf90ccfe04ff..aefedeffab614a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -950,6 +950,9 @@ void CodeGenModule::Release() {
       UsedArray.push_back(llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
           GetAddrOfGlobal(GD), Int8PtrTy));
     }
+    // Sort decls by name to always emit them in deterministic order.
+    llvm::sort(UsedArray,
+               [](auto A, auto B) { return A->getName() < B->getName(); });
 
     llvm::ArrayType *ATy = llvm::ArrayType::get(Int8PtrTy, UsedArray.size());
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/102661
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to