Added GetCanonicalType() to SBType:
authorGreg Clayton <gclayton@apple.com>
Sat, 8 Dec 2012 00:17:07 +0000 (00:17 +0000)
committerGreg Clayton <gclayton@apple.com>
Sat, 8 Dec 2012 00:17:07 +0000 (00:17 +0000)
lldb::SBType
SBType::GetCanonicalType();

llvm-svn: 169655

lldb/include/lldb/API/SBType.h
lldb/scripts/Python/interface/SBType.i
lldb/source/API/SBType.cpp

index 14ee24d..d313e20 100644 (file)
@@ -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
index 82dff14..9c2c826 100644 (file)
@@ -180,6 +180,9 @@ public:
     lldb::SBType
     GetUnqualifiedType();
     
+    lldb::SBType
+    GetCanonicalType();
+
     lldb::BasicType
     GetBasicType();
 
index 29c56a5..976bbf2 100644 (file)
@@ -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()
 {