From: Greg Clayton Date: Mon, 2 Jun 2014 21:58:30 +0000 (+0000) Subject: Small cleanups for the new enum fixes: X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bd024d4e8b852c0e088a30610368a330a9d722b;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index a315c1e..4d4e80a 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(""), 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 0663161..177493a 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 e79ff60..ce8666b 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; + } }