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
This commit is contained in:
Greg Clayton 2014-06-02 21:58:30 +00:00
parent 22b065c748
commit 4bd024d4e8
3 changed files with 18 additions and 10 deletions

View File

@ -792,7 +792,7 @@ class TypeEnumMemberImpl
{ {
public: public:
TypeEnumMemberImpl () : TypeEnumMemberImpl () :
m_integer_type(), m_integer_type_sp(),
m_name("<invalid>"), m_name("<invalid>"),
m_value(), m_value(),
m_valid(false) m_valid(false)
@ -803,7 +803,7 @@ public:
const lldb_private::ClangASTType& integer_type); const lldb_private::ClangASTType& integer_type);
TypeEnumMemberImpl (const TypeEnumMemberImpl& rhs) : 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_name(rhs.m_name),
m_value(rhs.m_value), m_value(rhs.m_value),
m_valid(rhs.m_valid) m_valid(rhs.m_valid)
@ -828,7 +828,7 @@ public:
const lldb::TypeImplSP & const lldb::TypeImplSP &
GetIntegerType () const GetIntegerType () const
{ {
return m_integer_type; return m_integer_type_sp;
} }
uint64_t uint64_t
@ -844,7 +844,7 @@ public:
} }
protected: protected:
lldb::TypeImplSP m_integer_type; lldb::TypeImplSP m_integer_type_sp;
ConstString m_name; ConstString m_name;
llvm::APSInt m_value; llvm::APSInt m_value;
bool m_valid; bool m_valid;

View File

@ -2091,8 +2091,6 @@
08FB7794FE84155DC02AAC07 /* lldb */ = { 08FB7794FE84155DC02AAC07 /* lldb */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */,
23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */,
26F5C32810F3DF7D009D5894 /* Libraries */, 26F5C32810F3DF7D009D5894 /* Libraries */,
264E8576159BE51A00E9D7A2 /* Resources */, 264E8576159BE51A00E9D7A2 /* Resources */,
08FB7795FE84155DC02AAC07 /* Source */, 08FB7795FE84155DC02AAC07 /* Source */,
@ -2522,6 +2520,8 @@
261744771168585B005ADD65 /* SBType.cpp */, 261744771168585B005ADD65 /* SBType.cpp */,
9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */, 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */,
9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */, 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */,
23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */,
23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */,
9461568614E355F2003A195C /* SBTypeFilter.h */, 9461568614E355F2003A195C /* SBTypeFilter.h */,
9461568A14E35621003A195C /* SBTypeFilter.cpp */, 9461568A14E35621003A195C /* SBTypeFilter.cpp */,
9461568714E355F2003A195C /* SBTypeFormat.h */, 9461568714E355F2003A195C /* SBTypeFormat.h */,

View File

@ -1171,9 +1171,17 @@ TypeImpl::GetDescription (lldb_private::Stream &strm,
TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl, TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
const lldb_private::ClangASTType& integer_type) : const lldb_private::ClangASTType& integer_type) :
m_value(enum_member_decl->getInitVal()), m_integer_type_sp(),
m_integer_type(new TypeImpl(integer_type)) m_name(),
m_value(),
m_valid(false)
{ {
m_name = ConstString(enum_member_decl->getNameAsString().c_str()); if (enum_member_decl)
m_valid = true; {
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;
}
} }