Commit f4390da0 by Ian Lance Taylor

compiler: add new debugging helper function debug_go_type()

    
    Add a new debugging utility routine debug_go_type(), intended to
    display the contents of a Type object in a way useful to debugging
    a run of the compiler.  Prior to this the only useful alternative
    for debugging types was invoking the mangled_name() method, which
    has problems (for example, won't work on interface types prior
    to finalizing of methods).
    
    This is a "deep" dump, meaning that all types reachable from the
    type passed to debug_go_type() will be printed out. Example:
    
    (gdb) print debug_go_type(t1)
          T0        0x535f300  'net/http.Header' -> T1
          T1        0x535d3d0  map ['string' -> string] T4
          T2        0x5304bb0  'string' -> string
          T3        0x331f900  string
          T4        0x535d370  array [] 'string' -> string
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166637

From-SVN: r269633
parent 50e021a5
3106ec19626d75d8275be16c86421132548fa13e
565b5cd0f49a00ca20941ea042c07ebe6ddf3553
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
......@@ -6951,7 +6951,7 @@ Type::make_struct_type(Struct_field_list* fields,
// called for a slice.
bool
Array_type::int_length(int64_t* plen)
Array_type::int_length(int64_t* plen) const
{
go_assert(this->length_ != NULL);
Numeric_constant nc;
......
......@@ -2706,7 +2706,7 @@ class Array_type : public Type
// length can not be determined. This will assert if called for a
// slice.
bool
int_length(int64_t* plen);
int_length(int64_t* plen) const;
// Whether this type is identical with T.
bool
......@@ -3160,6 +3160,11 @@ class Interface_type : public Type
static Type*
make_interface_type_descriptor_type();
// Return whether methods are finalized for this interface.
bool
methods_are_finalized() const
{ return this->methods_are_finalized_; }
protected:
int
do_traverse(Traverse*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment