[Lldb-commits] [lldb] r220824 - Add a few functions to SBType to handle arrays and typedefs. Fixes rdar://12675166
Enrico Granata
egranata at apple.com
Tue Oct 28 14:44:06 PDT 2014
Author: enrico
Date: Tue Oct 28 16:44:06 2014
New Revision: 220824
URL: http://llvm.org/viewvc/llvm-project?rev=220824&view=rev
Log:
Add a few functions to SBType to handle arrays and typedefs. Fixes rdar://12675166
Modified:
lldb/trunk/include/lldb/API/SBType.h
lldb/trunk/scripts/Python/interface/SBType.i
lldb/trunk/source/API/SBType.cpp
Modified: lldb/trunk/include/lldb/API/SBType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBType.h?rev=220824&r1=220823&r2=220824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBType.h (original)
+++ lldb/trunk/include/lldb/API/SBType.h Tue Oct 28 16:44:06 2014
@@ -149,6 +149,12 @@ public:
bool
IsPolymorphicClass ();
+ bool
+ IsArrayType ();
+
+ bool
+ IsTypedefType ();
+
lldb::SBType
GetPointerType();
@@ -166,6 +172,9 @@ public:
lldb::SBType
GetUnqualifiedType();
+
+ lldb::SBType
+ GetArrayElementType ();
lldb::SBType
GetCanonicalType();
Modified: lldb/trunk/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBType.i?rev=220824&r1=220823&r2=220824&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBType.i (original)
+++ lldb/trunk/scripts/Python/interface/SBType.i Tue Oct 28 16:44:06 2014
@@ -206,6 +206,12 @@ public:
bool
IsPolymorphicClass ();
+ bool
+ IsArrayType ();
+
+ bool
+ IsTypedefType ();
+
lldb::SBType
GetPointerType();
@@ -226,6 +232,9 @@ public:
lldb::SBType
GetCanonicalType();
+
+ lldb::SBType
+ GetArrayElementType ();
lldb::BasicType
GetBasicType();
Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=220824&r1=220823&r2=220824&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Tue Oct 28 16:44:06 2014
@@ -156,6 +156,14 @@ SBType::IsPointerType()
}
bool
+SBType::IsArrayType()
+{
+ if (!IsValid())
+ return false;
+ return m_opaque_sp->GetClangASTType(true).IsArrayType(nullptr, nullptr, nullptr);
+}
+
+bool
SBType::IsReferenceType()
{
if (!IsValid())
@@ -204,6 +212,14 @@ SBType::GetDereferencedType()
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType())));
}
+SBType
+SBType::GetArrayElementType()
+{
+ if (!IsValid())
+ return SBType();
+ return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetClangASTType(true).GetArrayElementType())));
+}
+
bool
SBType::IsFunctionType ()
{
@@ -220,7 +236,13 @@ SBType::IsPolymorphicClass ()
return m_opaque_sp->GetClangASTType(true).IsPolymorphicClass();
}
-
+bool
+SBType::IsTypedefType ()
+{
+ if (!IsValid())
+ return false;
+ return m_opaque_sp->GetClangASTType(true).IsTypedefType();
+}
lldb::SBType
SBType::GetFunctionReturnType ()
More information about the lldb-commits
mailing list