[Lldb-commits] [lldb] r247662 - Use uint64_t for GoArray size.

Bruce Mitchener via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 21:33:49 PDT 2015


Author: brucem
Date: Mon Sep 14 23:33:48 2015
New Revision: 247662

URL: http://llvm.org/viewvc/llvm-project?rev=247662&view=rev
Log:
Use uint64_t for GoArray size.

Summary:
This was int64_t, but all usages of it came from code that was passing
in unsigned values. The usages of the array size, except for one, were
also treating it as an unsigned value.  The usage that treated it as
signed was to try to figure out if it was a complete type or not, but
the callers creating the array didn't seem to be aware of using -1 as
an indicator for an incomplete array.

Reviewers: ribrdb, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D12872

Modified:
    lldb/trunk/include/lldb/Symbol/GoASTContext.h
    lldb/trunk/source/Symbol/GoASTContext.cpp

Modified: lldb/trunk/include/lldb/Symbol/GoASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=247662&r1=247661&r2=247662&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/GoASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/GoASTContext.h Mon Sep 14 23:33:48 2015
@@ -70,7 +70,7 @@ class GoASTContext : public TypeSystem
     // Creating Types
     //----------------------------------------------------------------------
 
-    CompilerType CreateArrayType(const ConstString &name, const CompilerType &element_type, int64_t length);
+    CompilerType CreateArrayType(const ConstString &name, const CompilerType &element_type, uint64_t length);
 
     CompilerType CreateBaseType(int go_kind, const ConstString &type_name_const_str, uint64_t byte_size);
 

Modified: lldb/trunk/source/Symbol/GoASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=247662&r1=247661&r2=247662&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/GoASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/GoASTContext.cpp Mon Sep 14 23:33:48 2015
@@ -140,20 +140,20 @@ class GoElem : public GoType
 class GoArray : public GoElem
 {
   public:
-    GoArray(const ConstString &name, int64_t length, const CompilerType &elem)
+    GoArray(const ConstString &name, uint64_t length, const CompilerType &elem)
         : GoElem(KIND_ARRAY, name, elem)
         , m_length(length)
     {
     }
 
-    int64_t
+    uint64_t
     GetLength() const
     {
         return m_length;
     }
 
   private:
-    int64_t m_length;
+    uint64_t m_length;
     GoArray(const GoArray &) = delete;
     const GoArray &operator=(const GoArray &) = delete;
 };
@@ -311,14 +311,7 @@ GoASTContext::IsArrayType(void *type, Co
     GoArray *array = static_cast<GoType *>(type)->GetArray();
     if (array)
     {
-        if (array->GetLength() == -1)
-        {
-            if (is_incomplete)
-            {
-                *is_incomplete = true;
-            }
-        }
-        else if (size)
+        if (size)
         {
             *size = array->GetLength();
         }
@@ -1297,7 +1290,7 @@ GoASTContext::DumpTypeDescription(void *
 }
 
 CompilerType
-GoASTContext::CreateArrayType(const ConstString &name, const CompilerType &element_type, int64_t length)
+GoASTContext::CreateArrayType(const ConstString &name, const CompilerType &element_type, uint64_t length)
 {
     GoType *type = new GoArray(name, length, element_type);
     (*m_types)[name].reset(type);




More information about the lldb-commits mailing list