summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-10-28 21:44:06 +0000
committerEnrico Granata <egranata@apple.com>2014-10-28 21:44:06 +0000
commite0afce767a500049184e294cb138a2f3fad0c3e0 (patch)
treeded5681162d3fcd61ffad01ac624a1e707806d53
parent90ff6428c92fd5cea4ad91f9087f5988ec1feb9c (diff)
downloadbcm5719-llvm-e0afce767a500049184e294cb138a2f3fad0c3e0.tar.gz
bcm5719-llvm-e0afce767a500049184e294cb138a2f3fad0c3e0.zip
Add a few functions to SBType to handle arrays and typedefs. Fixes rdar://12675166
llvm-svn: 220824
-rw-r--r--lldb/include/lldb/API/SBType.h9
-rw-r--r--lldb/scripts/Python/interface/SBType.i9
-rw-r--r--lldb/source/API/SBType.cpp24
3 files changed, 41 insertions, 1 deletions
diff --git a/lldb/include/lldb/API/SBType.h b/lldb/include/lldb/API/SBType.h
index dea87a915bd..303ddff6dc0 100644
--- a/lldb/include/lldb/API/SBType.h
+++ b/lldb/include/lldb/API/SBType.h
@@ -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();
diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i
index 2980cdb4dc7..a9c230cc165 100644
--- a/lldb/scripts/Python/interface/SBType.i
+++ b/lldb/scripts/Python/interface/SBType.i
@@ -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();
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 189cf81d417..8a0f5d848a3 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -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 ()
OpenPOWER on IntegriCloud