summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-06-02 21:58:30 +0000
committerGreg Clayton <gclayton@apple.com>2014-06-02 21:58:30 +0000
commit4bd024d4e8b852c0e088a30610368a330a9d722b (patch)
treee170379adf5d5322cdaa2bfc7a764ed368a1547c
parent22b065c7489907e6d8d4556127ce32de854d2fe9 (diff)
downloadbcm5719-llvm-4bd024d4e8b852c0e088a30610368a330a9d722b.tar.gz
bcm5719-llvm-4bd024d4e8b852c0e088a30610368a330a9d722b.zip
Small cleanups for the new enum fixes:
- Fix Xcode project to have source files for SBTypeEnumMember.h/SBTypeEnumMember.cpp in the right place - Rename a member variable to inluce "_sp" suffix since it is a shared pointer - Cleanup initialization code for TypeEnumMemberImpl to not warn about out of order initialization llvm-svn: 210051
-rw-r--r--lldb/include/lldb/Symbol/Type.h8
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj4
-rw-r--r--lldb/source/Symbol/Type.cpp16
3 files changed, 18 insertions, 10 deletions
diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h
index a315c1e3940..4d4e80a6126 100644
--- a/lldb/include/lldb/Symbol/Type.h
+++ b/lldb/include/lldb/Symbol/Type.h
@@ -792,7 +792,7 @@ class TypeEnumMemberImpl
{
public:
TypeEnumMemberImpl () :
- m_integer_type(),
+ m_integer_type_sp(),
m_name("<invalid>"),
m_value(),
m_valid(false)
@@ -803,7 +803,7 @@ public:
const lldb_private::ClangASTType& integer_type);
TypeEnumMemberImpl (const TypeEnumMemberImpl& rhs) :
- m_integer_type(rhs.m_integer_type),
+ m_integer_type_sp(rhs.m_integer_type_sp),
m_name(rhs.m_name),
m_value(rhs.m_value),
m_valid(rhs.m_valid)
@@ -828,7 +828,7 @@ public:
const lldb::TypeImplSP &
GetIntegerType () const
{
- return m_integer_type;
+ return m_integer_type_sp;
}
uint64_t
@@ -844,7 +844,7 @@ public:
}
protected:
- lldb::TypeImplSP m_integer_type;
+ lldb::TypeImplSP m_integer_type_sp;
ConstString m_name;
llvm::APSInt m_value;
bool m_valid;
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index 06631619426..177493a9064 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -2091,8 +2091,6 @@
08FB7794FE84155DC02AAC07 /* lldb */ = {
isa = PBXGroup;
children = (
- 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */,
- 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */,
26F5C32810F3DF7D009D5894 /* Libraries */,
264E8576159BE51A00E9D7A2 /* Resources */,
08FB7795FE84155DC02AAC07 /* Source */,
@@ -2522,6 +2520,8 @@
261744771168585B005ADD65 /* SBType.cpp */,
9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */,
9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */,
+ 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */,
+ 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */,
9461568614E355F2003A195C /* SBTypeFilter.h */,
9461568A14E35621003A195C /* SBTypeFilter.cpp */,
9461568714E355F2003A195C /* SBTypeFormat.h */,
diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp
index e79ff60cb2e..ce8666bc129 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -1171,9 +1171,17 @@ TypeImpl::GetDescription (lldb_private::Stream &strm,
TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
const lldb_private::ClangASTType& integer_type) :
- m_value(enum_member_decl->getInitVal()),
- m_integer_type(new TypeImpl(integer_type))
+ m_integer_type_sp(),
+ m_name(),
+ m_value(),
+ m_valid(false)
+
{
- m_name = ConstString(enum_member_decl->getNameAsString().c_str());
- m_valid = true;
+ if (enum_member_decl)
+ {
+ m_integer_type_sp.reset(new TypeImpl(integer_type));
+ m_name = ConstString(enum_member_decl->getNameAsString().c_str());
+ m_value = enum_member_decl->getInitVal();
+ m_valid = true;
+ }
}
OpenPOWER on IntegriCloud