[llvm] [NVPTX] Fix DWARF address space for globals (PR #122715)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 11:01:34 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 eb96c8c105226956c8ed5ab30699206f53de74f7 c094320bcc55333192929e19b2b17e44bcd3cd4f --extensions h,cpp -- llvm/include/llvm/Support/NVPTXAddrSpace.h llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index e2669e0283..6cf05fda54 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -383,8 +383,8 @@ void DwarfCompileUnit::addLocationAttribute(
       }
       if (Asm->TM.getTargetTriple().isNVPTX() && DD->tuneForGDB() &&
           !NVPTXAddressSpace)
-        NVPTXAddressSpace = translateToNVVMDWARFAddrSpace(
-            Global->getType()->getAddressSpace());
+        NVPTXAddressSpace =
+            translateToNVVMDWARFAddrSpace(Global->getType()->getAddressSpace());
     }
     // Global variables attached to symbols are memory locations.
     // It would be better if this were unconditional, but malformed input that

``````````

</details>


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


More information about the llvm-commits mailing list