[Lldb-commits] [lldb] [LLDB][NVIDIA] Add NVPTX architecture support (PR #158334)

via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 12 10:42:35 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Andrew Gontarek (agontarek)

<details>
<summary>Changes</summary>

- Introduced a new method `IsNVPTX()` in `ArchSpec` to check for NVPTX architecture.
- Implemented the corresponding method in `ArchSpec.cpp` to utilize the existing triple architecture checks.

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


2 Files Affected:

- (modified) lldb/include/lldb/Utility/ArchSpec.h (+5) 
- (modified) lldb/source/Utility/ArchSpec.cpp (+2) 


``````````diff
diff --git a/lldb/include/lldb/Utility/ArchSpec.h b/lldb/include/lldb/Utility/ArchSpec.h
index 96bd5e3597b68..361108fd8f0e7 100644
--- a/lldb/include/lldb/Utility/ArchSpec.h
+++ b/lldb/include/lldb/Utility/ArchSpec.h
@@ -327,6 +327,11 @@ class ArchSpec {
   ///  \return a boolean value.
   bool IsMIPS() const;
 
+  /// If NVPTX architecture return true.
+  ///
+  ///  \return a boolean value.
+  bool IsNVPTX() const;
+
   /// Returns a string representing current architecture as a target CPU for
   /// tools like compiler, disassembler etc.
   ///
diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp
index 1b8dae39735df..2a87cc6bf7de9 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -545,6 +545,8 @@ const char *ArchSpec::GetArchitectureName() const {
 
 bool ArchSpec::IsMIPS() const { return GetTriple().isMIPS(); }
 
+bool ArchSpec::IsNVPTX() const { return GetTriple().isNVPTX(); }
+
 std::string ArchSpec::GetTargetABI() const {
 
   std::string abi;

``````````

</details>


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


More information about the lldb-commits mailing list