diff options
Diffstat (limited to 'src/cmd/compile/internal/types/utils.go')
-rw-r--r-- | src/cmd/compile/internal/types/utils.go | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/cmd/compile/internal/types/utils.go b/src/cmd/compile/internal/types/utils.go index e8b1073818..a1be77eef1 100644 --- a/src/cmd/compile/internal/types/utils.go +++ b/src/cmd/compile/internal/types/utils.go @@ -15,51 +15,47 @@ const BADWIDTH = -1000000000 // They are here to break import cycles. // TODO(gri) eliminate these dependencies. var ( - Widthptr int - Dowidth func(*Type) - Fatalf func(string, ...interface{}) - Sconv func(*Sym, int, int) string // orig: func sconv(s *Sym, flag FmtFlag, mode fmtMode) string - Tconv func(*Type, int, int) string // orig: func tconv(t *Type, flag FmtFlag, mode fmtMode) string - FormatSym func(*Sym, fmt.State, rune, int) // orig: func symFormat(sym *Sym, s fmt.State, verb rune, mode fmtMode) - FormatType func(*Type, fmt.State, rune, int) // orig: func typeFormat(t *Type, s fmt.State, verb rune, mode fmtMode) - TypeLinkSym func(*Type) *obj.LSym - Ctxt *obj.Link - - FmtLeft int - FmtUnsigned int - FErr int + Widthptr int + Dowidth func(*Type) + SymString func(*Sym) string + TypeString func(*Type) string + TypeShortString func(*Type) string + TypeLongString func(*Type) string + FormatSym func(*Sym, fmt.State, rune) + FormatType func(*Type, fmt.State, rune) + TypeLinkSym func(*Type) *obj.LSym ) func (s *Sym) String() string { - return Sconv(s, 0, FErr) + return SymString(s) } func (sym *Sym) Format(s fmt.State, verb rune) { - FormatSym(sym, s, verb, FErr) + FormatSym(sym, s, verb) } func (t *Type) String() string { - // The implementation of tconv (including typefmt and fldconv) + // The implementation // must handle recursive types correctly. - return Tconv(t, 0, FErr) + return TypeString(t) } // ShortString generates a short description of t. // It is used in autogenerated method names, reflection, // and itab names. func (t *Type) ShortString() string { - return Tconv(t, FmtLeft, FErr) + return TypeShortString(t) } // LongString generates a complete description of t. // It is useful for reflection, // or when a unique fingerprint or hash of a type is required. func (t *Type) LongString() string { - return Tconv(t, FmtLeft|FmtUnsigned, FErr) + return TypeLongString(t) } func (t *Type) Format(s fmt.State, verb rune) { - FormatType(t, s, verb, FErr) + FormatType(t, s, verb) } type bitset8 uint8 |