[llvm] [WebAssembly] Add path to PIC mode for wasm tables (PR #67545)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 05:04:17 PDT 2023


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 08136d822c73e9f2c042db25c4b45a4cb6cafed1 6dc3864d925bc878ae28efaf508ff5dc7ae07147 -- llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index b67615d82d04..967f7ec0c152 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -1726,12 +1726,13 @@ SDValue WebAssemblyTargetLowering::LowerGlobalAddress(SDValue Op,
   unsigned OperandFlags = 0;
   const GlobalValue *GV = GA->getGlobal();
   // is PIC but not a WebAssembly table.
-  // Since WebAssembly tables cannot yet be shared accross modules, we don't need special
-  // treatment for tables in PIC mode.
-  if (isPositionIndependent() && 
-      !(GV->getValueType()->isArrayTy() && 
-        WebAssembly::isWebAssemblyReferenceType(GV->getValueType()->getArrayElementType()))) {
-    
+  // Since WebAssembly tables cannot yet be shared accross modules, we don't
+  // need special treatment for tables in PIC mode.
+  if (isPositionIndependent() &&
+      !(GV->getValueType()->isArrayTy() &&
+        WebAssembly::isWebAssemblyReferenceType(
+            GV->getValueType()->getArrayElementType()))) {
+
     if (getTargetMachine().shouldAssumeDSOLocal(*GV->getParent(), GV)) {
       MachineFunction &MF = DAG.getMachineFunction();
       MVT PtrVT = getPointerTy(MF.getDataLayout());

``````````

</details>


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


More information about the llvm-commits mailing list