[clang] [llvm] [Clang][OpenMP] Port clang codegen code for openmp porject (PR #85795)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 07:26:26 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 208a9850e6a4b64ad6311361735d27a9c6cbd8ec 1b54da5f9dece1bf307acc12042b044011237d9c -- clang/lib/CodeGen/CGBuilder.h clang/lib/CodeGen/CGDecl.cpp clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGBuilder.h b/clang/lib/CodeGen/CGBuilder.h
index fe5beff051..70527033a0 100644
--- a/clang/lib/CodeGen/CGBuilder.h
+++ b/clang/lib/CodeGen/CGBuilder.h
@@ -160,7 +160,7 @@ public:
     return Address(CreateBitCast(Addr.getPointer(), PtrTy, Name), Ty,
                    Addr.getAlignment(), Addr.isKnownNonNull());
   }
-  
+
   using CGBuilderBaseTy::CreatePointerBitCastOrAddrSpaceCast;
   Address CreatePointerBitCastOrAddrSpaceCast(Address Addr, llvm::Type *Ty,
                                               llvm::Type *ElementTy,
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
index 8f0c7caa2f..edeb5b7eb7 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
@@ -1152,11 +1152,11 @@ CGOpenMPRuntimeGPU::getKmpcAllocShared(CodeGenFunction &CGF,
   // Allocate space for this VLA object to be globalized.
   llvm::Value *AllocArgs[] = {Size};
   llvm::CallBase *VoidPtr = CGF.EmitRuntimeCall(
-        OMPBuilder.getOrCreateRuntimeFunction(
-            CGM.getModule(), CGM.getLangOpts().OpenMPGlobalizeToGlobalSpace
-                                 ? OMPRTL_malloc
-                                 : OMPRTL___kmpc_alloc_shared),
-        AllocArgs, VD->getName());
+      OMPBuilder.getOrCreateRuntimeFunction(
+          CGM.getModule(), CGM.getLangOpts().OpenMPGlobalizeToGlobalSpace
+                               ? OMPRTL_malloc
+                               : OMPRTL___kmpc_alloc_shared),
+      AllocArgs, VD->getName());
   VoidPtr->addRetAttr(llvm::Attribute::get(
       CGM.getLLVMContext(), llvm::Attribute::Alignment, Align.getQuantity()));
 

``````````

</details>


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


More information about the cfe-commits mailing list