[Lldb-commits] [lldb] r210051 - Small cleanups for the new enum fixes:

Greg Clayton gclayton at apple.com
Mon Jun 2 14:58:30 PDT 2014


Author: gclayton
Date: Mon Jun  2 16:58:30 2014
New Revision: 210051

URL: http://llvm.org/viewvc/llvm-project?rev=210051&view=rev
Log:
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


Modified:
    lldb/trunk/include/lldb/Symbol/Type.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=210051&r1=210050&r2=210051&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Mon Jun  2 16:58:30 2014
@@ -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;

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=210051&r1=210050&r2=210051&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jun  2 16:58:30 2014
@@ -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 */,

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=210051&r1=210050&r2=210051&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Mon Jun  2 16:58:30 2014
@@ -1171,9 +1171,17 @@ TypeImpl::GetDescription (lldb_private::
 
 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;
+    }
 }





More information about the lldb-commits mailing list