[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 19:07:56 PDT 2024


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 aa98c75da49515fb399e2682dfe34c563d44bdf6 b41326be998e0f78db335dc6298144f805ab0d56 -- clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGen/asan-constructor.c clang/test/CodeGen/attr-retain.c clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp clang/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp clang/test/OpenMP/amdgcn_target_global_constructor.cpp llvm/lib/Transforms/Utils/ModuleUtils.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index b59c5c5278..c12a2f4719 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2065,11 +2065,10 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) {
     ctor.finishAndAddTo(ctors);
   }
 
-  auto list =
-    ctors.finishAndCreateGlobal(GlobalName, getPointerAlign(),
-                                /*constant*/ false,
-                                llvm::GlobalValue::AppendingLinkage,
-                                GlobalsInt8PtrTy->getAddressSpace());
+  auto list = ctors.finishAndCreateGlobal(GlobalName, getPointerAlign(),
+                                          /*constant*/ false,
+                                          llvm::GlobalValue::AppendingLinkage,
+                                          GlobalsInt8PtrTy->getAddressSpace());
 
   // The LTO linker doesn't seem to like it when we set an alignment
   // on appending variables.  Take it off as a workaround.

``````````

</details>


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


More information about the llvm-commits mailing list