From 315501e2541313e1108ed78970a78752d8038c9e Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 8 Dec 2012 00:17:07 +0000 Subject: [PATCH] Added GetCanonicalType() to SBType: lldb::SBType SBType::GetCanonicalType(); llvm-svn: 169655 --- lldb/include/lldb/API/SBType.h | 2 ++ lldb/scripts/Python/interface/SBType.i | 3 +++ lldb/source/API/SBType.cpp | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/lldb/include/lldb/API/SBType.h b/lldb/include/lldb/API/SBType.h index 14ee24d..d313e20 100644 --- a/lldb/include/lldb/API/SBType.h +++ b/lldb/include/lldb/API/SBType.h @@ -108,6 +108,8 @@ public: lldb::SBType GetUnqualifiedType(); + lldb::SBType + GetCanonicalType(); // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic // type eBasicTypeInvalid will be returned lldb::BasicType diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index 82dff14..9c2c826 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -180,6 +180,9 @@ public: lldb::SBType GetUnqualifiedType(); + lldb::SBType + GetCanonicalType(); + lldb::BasicType GetBasicType(); diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 29c56a5..976bbf2 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -274,6 +274,18 @@ SBType::GetUnqualifiedType() return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getUnqualifiedType().getAsOpaquePtr())); } +lldb::SBType +SBType::GetCanonicalType() +{ + if (IsValid()) + { + QualType qt (QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType())); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getCanonicalType().getAsOpaquePtr())); + } + return SBType(); +} + + lldb::BasicType SBType::GetBasicType() { -- 2.7.4