Go: cmd/vendor/github.com/ianlancetaylor/demangle Index | Files

package demangle

import "cmd/vendor/github.com/ianlancetaylor/demangle"

Package demangle defines functions that demangle GCC/LLVM C++ symbol names. This package recognizes names that were mangled according to the C++ ABI defined at http://codesourcery.com/cxx-abi/.

Index

Package Files

ast.go demangle.go

Variables

var ErrNotMangledName = errors.New("not a C++ mangled name")

ErrNotMangledName is returned by CheckedDemangle if the string does not appear to be a C++ symbol name.

func ASTToString Uses

func ASTToString(a AST, options ...Option) string

ASTToString returns the demangled name of the AST.

func Filter Uses

func Filter(name string, options ...Option) string

Filter demangles a C++ symbol name, returning the human-readable C++ name. If any error occurs during demangling, the input string is returned.

func ToString Uses

func ToString(name string, options ...Option) (string, error)

ToString demangles a C++ symbol name, returning human-readable C++ name or an error. If the name does not appear to be a C++ symbol name at all, the error will be ErrNotMangledName.

type AST Uses

type AST interface {

    // Traverse each element of an AST.  If the function returns
    // false, traversal of children of that element is skipped.
    Traverse(func(AST) bool)

    // Copy an AST with possible transformations.
    // If the skip function returns true, no copy is required.
    // If the copy function returns nil, no copy is required.
    // Otherwise the AST returned by copy is used in a copy of the full AST.
    // Copy itself returns either a copy or nil.
    Copy(copy func(AST) AST, skip func(AST) bool) AST

    // Implement the fmt.GoStringer interface.
    GoString() string
    // contains filtered or unexported methods
}

AST is an abstract syntax tree representing a C++ declaration. This is sufficient for the demangler but is by no means a general C++ AST.

func ToAST Uses

func ToAST(name string, options ...Option) (AST, error)

ToAST demangles a C++ symbol name into an abstract syntax tree representing the symbol. If the NoParams option is passed, and the name has a function type, the parameter types are not demangled. If the name does not appear to be a C++ symbol name at all, the error will be ErrNotMangledName.

type ArgumentPack Uses

type ArgumentPack struct {
    Args []AST
}

ArgumentPack is an argument pack.

func (*ArgumentPack) Copy Uses

func (ap *ArgumentPack) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ArgumentPack) GoString Uses

func (ap *ArgumentPack) GoString() string

func (*ArgumentPack) Traverse Uses

func (ap *ArgumentPack) Traverse(fn func(AST) bool)

type ArrayType Uses

type ArrayType struct {
    Dimension AST
    Element   AST
}

ArrayType is an array type.

func (*ArrayType) Copy Uses

func (at *ArrayType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ArrayType) GoString Uses

func (at *ArrayType) GoString() string

func (*ArrayType) Traverse Uses

func (at *ArrayType) Traverse(fn func(AST) bool)

type Binary Uses

type Binary struct {
    Op    AST
    Left  AST
    Right AST
}

Binary is a binary operation in an expression.

func (*Binary) Copy Uses

func (b *Binary) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Binary) GoString Uses

func (b *Binary) GoString() string

func (*Binary) Traverse Uses

func (b *Binary) Traverse(fn func(AST) bool)

type BuiltinType Uses

type BuiltinType struct {
    Name string
}

BuiltinType is a builtin type, like "int".

func (*BuiltinType) Copy Uses

func (bt *BuiltinType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*BuiltinType) GoString Uses

func (bt *BuiltinType) GoString() string

func (*BuiltinType) Traverse Uses

func (bt *BuiltinType) Traverse(fn func(AST) bool)

type Cast Uses

type Cast struct {
    To AST
}

Cast is a type cast.

func (*Cast) Copy Uses

func (c *Cast) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Cast) GoString Uses

func (c *Cast) GoString() string

func (*Cast) Traverse Uses

func (c *Cast) Traverse(fn func(AST) bool)

type Clone Uses

type Clone struct {
    Base   AST
    Suffix string
}

Clone is a clone of a function, with a distinguishing suffix.

func (*Clone) Copy Uses

func (c *Clone) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Clone) GoString Uses

func (c *Clone) GoString() string

func (*Clone) Traverse Uses

func (c *Clone) Traverse(fn func(AST) bool)

type Closure Uses

type Closure struct {
    Types []AST
    Num   int
}

Closure is a closure, or lambda expression.

func (*Closure) Copy Uses

func (cl *Closure) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Closure) GoString Uses

func (cl *Closure) GoString() string

func (*Closure) Traverse Uses

func (cl *Closure) Traverse(fn func(AST) bool)

type ComplexType Uses

type ComplexType struct {
    Base AST
}

ComplexType is a complex type.

func (*ComplexType) Copy Uses

func (ct *ComplexType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ComplexType) GoString Uses

func (ct *ComplexType) GoString() string

func (*ComplexType) Traverse Uses

func (ct *ComplexType) Traverse(fn func(AST) bool)

type Constructor Uses

type Constructor struct {
    Name AST
}

Constructor is a constructor.

func (*Constructor) Copy Uses

func (c *Constructor) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Constructor) GoString Uses

func (c *Constructor) GoString() string

func (*Constructor) Traverse Uses

func (c *Constructor) Traverse(fn func(AST) bool)

type Decltype Uses

type Decltype struct {
    Expr AST
}

Decltype is the decltype operator.

func (*Decltype) Copy Uses

func (dt *Decltype) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Decltype) GoString Uses

func (dt *Decltype) GoString() string

func (*Decltype) Traverse Uses

func (dt *Decltype) Traverse(fn func(AST) bool)

type DefaultArg Uses

type DefaultArg struct {
    Num int
    Arg AST
}

DefaultArg holds a default argument for a local name.

func (*DefaultArg) Copy Uses

func (da *DefaultArg) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*DefaultArg) GoString Uses

func (da *DefaultArg) GoString() string

func (*DefaultArg) Traverse Uses

func (da *DefaultArg) Traverse(fn func(AST) bool)

type Destructor Uses

type Destructor struct {
    Name AST
}

Destructor is a destructor.

func (*Destructor) Copy Uses

func (d *Destructor) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Destructor) GoString Uses

func (d *Destructor) GoString() string

func (*Destructor) Traverse Uses

func (d *Destructor) Traverse(fn func(AST) bool)

type ExprList Uses

type ExprList struct {
    Exprs []AST
}

ExprList is a list of expressions, typically arguments to a function call in an expression.

func (*ExprList) Copy Uses

func (el *ExprList) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ExprList) GoString Uses

func (el *ExprList) GoString() string

func (*ExprList) Traverse Uses

func (el *ExprList) Traverse(fn func(AST) bool)

type FixedType Uses

type FixedType struct {
    Base  AST
    Accum bool
    Sat   bool
}

FixedType is a fixed numeric type of unknown size.

func (*FixedType) Copy Uses

func (ft *FixedType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*FixedType) GoString Uses

func (ft *FixedType) GoString() string

func (*FixedType) Traverse Uses

func (ft *FixedType) Traverse(fn func(AST) bool)

type Fold Uses

type Fold struct {
    Left bool
    Op   AST
    Arg1 AST
    Arg2 AST
}

Fold is a C++17 fold-expression. Arg2 is nil for a unary operator.

func (*Fold) Copy Uses

func (f *Fold) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Fold) GoString Uses

func (f *Fold) GoString() string

func (*Fold) Traverse Uses

func (f *Fold) Traverse(fn func(AST) bool)

type FunctionParam Uses

type FunctionParam struct {
    Index int
}

FunctionParam is a parameter of a function, used for last-specified return type in a closure.

func (*FunctionParam) Copy Uses

func (fp *FunctionParam) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*FunctionParam) GoString Uses

func (fp *FunctionParam) GoString() string

func (*FunctionParam) Traverse Uses

func (fp *FunctionParam) Traverse(fn func(AST) bool)

type FunctionType Uses

type FunctionType struct {
    Return AST
    Args   []AST
}

FunctionType is a function type. The Return field may be nil for cases where the return type is not part of the mangled name.

func (*FunctionType) Copy Uses

func (ft *FunctionType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*FunctionType) GoString Uses

func (ft *FunctionType) GoString() string

func (*FunctionType) Traverse Uses

func (ft *FunctionType) Traverse(fn func(AST) bool)

type GlobalCDtor Uses

type GlobalCDtor struct {
    Ctor bool
    Key  AST
}

GlobalCDtor is a global constructor or destructor.

func (*GlobalCDtor) Copy Uses

func (gcd *GlobalCDtor) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*GlobalCDtor) GoString Uses

func (gcd *GlobalCDtor) GoString() string

func (*GlobalCDtor) Traverse Uses

func (gcd *GlobalCDtor) Traverse(fn func(AST) bool)

type ImaginaryType Uses

type ImaginaryType struct {
    Base AST
}

ImaginaryType is an imaginary type.

func (*ImaginaryType) Copy Uses

func (it *ImaginaryType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ImaginaryType) GoString Uses

func (it *ImaginaryType) GoString() string

func (*ImaginaryType) Traverse Uses

func (it *ImaginaryType) Traverse(fn func(AST) bool)

type InitializerList Uses

type InitializerList struct {
    Type  AST
    Exprs AST
}

InitializerList is an initializer list: an optional type with a list of expressions.

func (*InitializerList) Copy Uses

func (il *InitializerList) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*InitializerList) GoString Uses

func (il *InitializerList) GoString() string

func (*InitializerList) Traverse Uses

func (il *InitializerList) Traverse(fn func(AST) bool)

type Literal Uses

type Literal struct {
    Type AST
    Val  string
    Neg  bool
}

Literal is a literal in an expression.

func (*Literal) Copy Uses

func (l *Literal) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Literal) GoString Uses

func (l *Literal) GoString() string

func (*Literal) Traverse Uses

func (l *Literal) Traverse(fn func(AST) bool)

type MethodWithQualifiers Uses

type MethodWithQualifiers struct {
    Method       AST
    Qualifiers   Qualifiers
    RefQualifier string // "" or "&" or "&&"
}

MethodWithQualifiers is a method with qualifiers.

func (*MethodWithQualifiers) Copy Uses

func (mwq *MethodWithQualifiers) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*MethodWithQualifiers) GoString Uses

func (mwq *MethodWithQualifiers) GoString() string

func (*MethodWithQualifiers) Traverse Uses

func (mwq *MethodWithQualifiers) Traverse(fn func(AST) bool)

type Name Uses

type Name struct {
    Name string
}

Name is an unqualified name.

func (*Name) Copy Uses

func (n *Name) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Name) GoString Uses

func (n *Name) GoString() string

func (*Name) Traverse Uses

func (n *Name) Traverse(fn func(AST) bool)

type New Uses

type New struct {
    Op    AST
    Place AST
    Type  AST
    Init  AST
}

New is a use of operator new in an expression.

func (*New) Copy Uses

func (n *New) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*New) GoString Uses

func (n *New) GoString() string

func (*New) Traverse Uses

func (n *New) Traverse(fn func(AST) bool)

type Nullary Uses

type Nullary struct {
    Op AST
}

Nullary is an operator in an expression with no arguments, such as throw.

func (*Nullary) Copy Uses

func (n *Nullary) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Nullary) GoString Uses

func (n *Nullary) GoString() string

func (*Nullary) Traverse Uses

func (n *Nullary) Traverse(fn func(AST) bool)

type Operator Uses

type Operator struct {
    Name string
}

Operator is an operator.

func (*Operator) Copy Uses

func (op *Operator) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Operator) GoString Uses

func (op *Operator) GoString() string

func (*Operator) Traverse Uses

func (op *Operator) Traverse(fn func(AST) bool)

type Option Uses

type Option int

Option is the type of demangler options.

const (
    // The NoParams option disables demangling of function parameters.
    NoParams Option = iota

    // The NoTemplateParams option disables demangling of template parameters.
    NoTemplateParams

    // The NoClones option disables inclusion of clone suffixes.
    // NoParams implies NoClones.
    NoClones

    // The Verbose option turns on more verbose demangling.
    Verbose
)

type PackExpansion Uses

type PackExpansion struct {
    Base AST
    Pack *ArgumentPack
}

PackExpansion is a pack expansion. The Pack field may be nil.

func (*PackExpansion) Copy Uses

func (pe *PackExpansion) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*PackExpansion) GoString Uses

func (pe *PackExpansion) GoString() string

func (*PackExpansion) Traverse Uses

func (pe *PackExpansion) Traverse(fn func(AST) bool)

type PointerType Uses

type PointerType struct {
    Base AST
}

PointerType is a pointer type.

func (*PointerType) Copy Uses

func (pt *PointerType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*PointerType) GoString Uses

func (pt *PointerType) GoString() string

func (*PointerType) Traverse Uses

func (pt *PointerType) Traverse(fn func(AST) bool)

type PtrMem Uses

type PtrMem struct {
    Class  AST
    Member AST
}

PtrMem is a pointer-to-member expression.

func (*PtrMem) Copy Uses

func (pm *PtrMem) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*PtrMem) GoString Uses

func (pm *PtrMem) GoString() string

func (*PtrMem) Traverse Uses

func (pm *PtrMem) Traverse(fn func(AST) bool)

type Qualified Uses

type Qualified struct {
    Scope AST
    Name  AST

    // The LocalName field is true if this is parsed as a
    // <local-name>.  We shouldn't really need this, but in some
    // cases (for the unary sizeof operator) the standard
    // demangler prints a local name slightly differently.  We
    // keep track of this for compatibility.
    LocalName bool // A full local name encoding
}

Qualified is a name in a scope.

func (*Qualified) Copy Uses

func (q *Qualified) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Qualified) GoString Uses

func (q *Qualified) GoString() string

func (*Qualified) Traverse Uses

func (q *Qualified) Traverse(fn func(AST) bool)

type Qualifiers Uses

type Qualifiers []string

Qualifiers is an ordered list of type qualifiers.

type ReferenceType Uses

type ReferenceType struct {
    Base AST
}

ReferenceType is a reference type.

func (*ReferenceType) Copy Uses

func (rt *ReferenceType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*ReferenceType) GoString Uses

func (rt *ReferenceType) GoString() string

func (*ReferenceType) Traverse Uses

func (rt *ReferenceType) Traverse(fn func(AST) bool)

type RvalueReferenceType Uses

type RvalueReferenceType struct {
    Base AST
}

RvalueReferenceType is an rvalue reference type.

func (*RvalueReferenceType) Copy Uses

func (rt *RvalueReferenceType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*RvalueReferenceType) GoString Uses

func (rt *RvalueReferenceType) GoString() string

func (*RvalueReferenceType) Traverse Uses

func (rt *RvalueReferenceType) Traverse(fn func(AST) bool)

type SizeofArgs Uses

type SizeofArgs struct {
    Args []AST
}

SizeofArgs is the size of a captured template parameter pack from an alias template.

func (*SizeofArgs) Copy Uses

func (sa *SizeofArgs) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*SizeofArgs) GoString Uses

func (sa *SizeofArgs) GoString() string

func (*SizeofArgs) Traverse Uses

func (sa *SizeofArgs) Traverse(fn func(AST) bool)

type SizeofPack Uses

type SizeofPack struct {
    Pack *ArgumentPack
}

SizeofPack is the sizeof operator applied to an argument pack.

func (*SizeofPack) Copy Uses

func (sp *SizeofPack) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*SizeofPack) GoString Uses

func (sp *SizeofPack) GoString() string

func (*SizeofPack) Traverse Uses

func (sp *SizeofPack) Traverse(fn func(AST) bool)

type Special Uses

type Special struct {
    Prefix string
    Val    AST
}

Special is a special symbol, printed as a prefix plus another value.

func (*Special) Copy Uses

func (s *Special) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Special) GoString Uses

func (s *Special) GoString() string

func (*Special) Traverse Uses

func (s *Special) Traverse(fn func(AST) bool)

type Special2 Uses

type Special2 struct {
    Prefix string
    Val1   AST
    Middle string
    Val2   AST
}

Special2 is like special, but uses two values.

func (*Special2) Copy Uses

func (s *Special2) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Special2) GoString Uses

func (s *Special2) GoString() string

func (*Special2) Traverse Uses

func (s *Special2) Traverse(fn func(AST) bool)

type TaggedName Uses

type TaggedName struct {
    Name AST
    Tag  AST
}

TaggedName is a name with an ABI tag.

func (*TaggedName) Copy Uses

func (t *TaggedName) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*TaggedName) GoString Uses

func (t *TaggedName) GoString() string

func (*TaggedName) Traverse Uses

func (t *TaggedName) Traverse(fn func(AST) bool)

type Template Uses

type Template struct {
    Name AST
    Args []AST
}

Template is a template with arguments.

func (*Template) Copy Uses

func (t *Template) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Template) GoString Uses

func (t *Template) GoString() string

func (*Template) Traverse Uses

func (t *Template) Traverse(fn func(AST) bool)

type TemplateParam Uses

type TemplateParam struct {
    Index    int
    Template *Template
}

TemplateParam is a template parameter. The Template field is filled in while parsing the demangled string. We don't normally see these while printing--they are replaced by the simplify function.

func (*TemplateParam) Copy Uses

func (tp *TemplateParam) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*TemplateParam) GoString Uses

func (tp *TemplateParam) GoString() string

func (*TemplateParam) Traverse Uses

func (tp *TemplateParam) Traverse(fn func(AST) bool)

type Trinary Uses

type Trinary struct {
    Op     AST
    First  AST
    Second AST
    Third  AST
}

Trinary is the ?: trinary operation in an expression.

func (*Trinary) Copy Uses

func (t *Trinary) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Trinary) GoString Uses

func (t *Trinary) GoString() string

func (*Trinary) Traverse Uses

func (t *Trinary) Traverse(fn func(AST) bool)

type TypeWithQualifiers Uses

type TypeWithQualifiers struct {
    Base       AST
    Qualifiers Qualifiers
}

TypeWithQualifiers is a type with standard qualifiers.

func (*TypeWithQualifiers) Copy Uses

func (twq *TypeWithQualifiers) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*TypeWithQualifiers) GoString Uses

func (twq *TypeWithQualifiers) GoString() string

func (*TypeWithQualifiers) Traverse Uses

func (twq *TypeWithQualifiers) Traverse(fn func(AST) bool)

type Typed Uses

type Typed struct {
    Name AST
    Type AST
}

Typed is a typed name.

func (*Typed) Copy Uses

func (t *Typed) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Typed) GoString Uses

func (t *Typed) GoString() string

func (*Typed) Traverse Uses

func (t *Typed) Traverse(fn func(AST) bool)

type Unary Uses

type Unary struct {
    Op         AST
    Expr       AST
    Suffix     bool // true for ++ -- when used as postfix
    SizeofType bool // true for sizeof (type)
}

Unary is a unary operation in an expression.

func (*Unary) Copy Uses

func (u *Unary) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*Unary) GoString Uses

func (u *Unary) GoString() string

func (*Unary) Traverse Uses

func (u *Unary) Traverse(fn func(AST) bool)

type UnnamedType Uses

type UnnamedType struct {
    Num int
}

UnnamedType is an unnamed type, that just has an index.

func (*UnnamedType) Copy Uses

func (ut *UnnamedType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*UnnamedType) GoString Uses

func (ut *UnnamedType) GoString() string

func (*UnnamedType) Traverse Uses

func (ut *UnnamedType) Traverse(fn func(AST) bool)

type VectorType Uses

type VectorType struct {
    Dimension AST
    Base      AST
}

VectorType is a vector type.

func (*VectorType) Copy Uses

func (vt *VectorType) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*VectorType) GoString Uses

func (vt *VectorType) GoString() string

func (*VectorType) Traverse Uses

func (vt *VectorType) Traverse(fn func(AST) bool)

type VendorQualifier Uses

type VendorQualifier struct {
    Qualifier AST
    Type      AST
}

VendorQualifier is a type qualified by a vendor-specific qualifier.

func (*VendorQualifier) Copy Uses

func (vq *VendorQualifier) Copy(fn func(AST) AST, skip func(AST) bool) AST

func (*VendorQualifier) GoString Uses

func (vq *VendorQualifier) GoString() string

func (*VendorQualifier) Traverse Uses

func (vq *VendorQualifier) Traverse(fn func(AST) bool)

Package demangle imports 4 packages (graph). Updated 2018-12-16. Refresh now. Tools for package owners.