summaryrefslogtreecommitdiffstats
path: root/source/API/SBType.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-11-25 21:00:58 +0000
committeremaste <emaste@FreeBSD.org>2014-11-25 21:00:58 +0000
commit01ee1789d6aa7294e5966a97f8d29387f6f81699 (patch)
treec94307da318be46e5aeea1a325c1e91749506e4f /source/API/SBType.cpp
parent788502c6f6261e2d84ef85d1052b41a6c5be31b3 (diff)
downloadFreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.zip
FreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.tar.gz
Import LLDB as of upstream SVN r216948 (git 50f7fe44)
This corresponds with the branchpoint for the 3.5 release. A number of files not required for the FreeBSD build have been removed. Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/API/SBType.cpp')
-rw-r--r--source/API/SBType.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp
index 5ca7ddf..064fb32 100644
--- a/source/API/SBType.cpp
+++ b/source/API/SBType.cpp
@@ -9,6 +9,7 @@
#include "lldb/API/SBDefines.h"
#include "lldb/API/SBType.h"
+#include "lldb/API/SBTypeEnumMember.h"
#include "lldb/API/SBStream.h"
#include "lldb/Core/ConstString.h"
#include "lldb/Core/Log.h"
@@ -17,6 +18,8 @@
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/Type.h"
+#include "clang/AST/Decl.h"
+
using namespace lldb;
using namespace lldb_private;
using namespace clang;
@@ -364,6 +367,27 @@ SBType::GetVirtualBaseClassAtIndex (uint32_t idx)
return sb_type_member;
}
+SBTypeEnumMemberList
+SBType::GetEnumMembers ()
+{
+ SBTypeEnumMemberList sb_enum_member_list;
+ if (IsValid())
+ {
+ const clang::EnumDecl *enum_decl = m_opaque_sp->GetClangASTType(true).GetFullyUnqualifiedType().GetAsEnumDecl();
+ if (enum_decl)
+ {
+ clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
+ for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
+ {
+ SBTypeEnumMember enum_member;
+ enum_member.reset(new TypeEnumMemberImpl(*enum_pos, ClangASTType(m_opaque_sp->GetClangASTContext(true), enum_decl->getIntegerType())));
+ sb_enum_member_list.Append(enum_member);
+ }
+ }
+ }
+ return sb_enum_member_list;
+}
+
SBTypeMember
SBType::GetFieldAtIndex (uint32_t idx)
{
@@ -414,6 +438,14 @@ SBType::GetName()
return m_opaque_sp->GetName().GetCString();
}
+const char *
+SBType::GetDisplayTypeName ()
+{
+ if (!IsValid())
+ return "";
+ return m_opaque_sp->GetDisplayTypeName().GetCString();
+}
+
lldb::TypeClass
SBType::GetTypeClass ()
{
OpenPOWER on IntegriCloud