Skip to content

Conversation

agontarek
Copy link
Contributor

  • 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.

- 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.
@agontarek
Copy link
Contributor Author

@clayborg @walter-erquinigo Please review.

@llvmbot
Copy link
Member

llvmbot commented Sep 12, 2025

@llvm/pr-subscribers-lldb

Author: Andrew Gontarek (agontarek)

Changes
  • 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 --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;

@agontarek
Copy link
Contributor Author

The buildbot failure is unrelated to this change.

@walter-erquinigo walter-erquinigo merged commit 4826039 into llvm:main Sep 12, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants