From 66016fd806571e3cc243aade0c36f86d45c32626 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 10 Nov 2011 19:20:52 +0000 Subject: [PATCH] Added the ability to get a type without qualifiers (const, volatile, restrict, etc). llvm-svn: 144302 --- lldb/include/lldb/API/SBType.h | 5 ++++- lldb/scripts/Python/interface/SBType.i | 3 +++ lldb/source/API/SBType.cpp | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lldb/include/lldb/API/SBType.h b/lldb/include/lldb/API/SBType.h index 5989ea769d47..7aa4252d3ca7 100644 --- a/lldb/include/lldb/API/SBType.h +++ b/lldb/include/lldb/API/SBType.h @@ -92,7 +92,10 @@ public: lldb::SBType GetDereferencedType(); - + + lldb::SBType + GetUnqualifiedType(); + lldb::SBType GetBasicType(lldb::BasicType type); diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index 589287a2d38e..2cc384085b62 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -142,6 +142,9 @@ public: lldb::SBType GetDereferencedType(); + lldb::SBType + GetUnqualifiedType(); + lldb::SBType GetBasicType (lldb::BasicType type); diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 8deb01c50afc..3064398e574e 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -211,6 +211,17 @@ SBType::GetDereferencedType() return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getNonReferenceType().getAsOpaquePtr())); } +lldb::SBType +SBType::GetUnqualifiedType() +{ + if (!IsValid()) + return SBType(); + + QualType qt (QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType())); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getUnqualifiedType().getAsOpaquePtr())); +} + + SBType SBType::GetBasicType(lldb::BasicType type) {