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/.
ErrNotMangledName is returned by CheckedDemangle if the string does not appear to be a C++ symbol name.
ASTToString returns the demangled name of the AST.
Filter demangles a C++ symbol name, returning the human-readable C++ name. If any error occurs during demangling, the input string is returned.
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 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.
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.
ArgumentPack is an argument pack.
func (ap *ArgumentPack) GoString() string
func (ap *ArgumentPack) Traverse(fn func(AST) bool)
ArrayType is an array type.
Binary is a binary operation in an expression.
BuiltinType is a builtin type, like "int".
func (bt *BuiltinType) GoString() string
func (bt *BuiltinType) Traverse(fn func(AST) bool)
Cast is a type cast.
Clone is a clone of a function, with a distinguishing suffix.
Closure is a closure, or lambda expression.
ComplexType is a complex type.
func (ct *ComplexType) GoString() string
func (ct *ComplexType) Traverse(fn func(AST) bool)
Constructor is a constructor.
func (c *Constructor) GoString() string
func (c *Constructor) Traverse(fn func(AST) bool)
Decltype is the decltype operator.
DefaultArg holds a default argument for a local name.
func (da *DefaultArg) GoString() string
func (da *DefaultArg) Traverse(fn func(AST) bool)
Destructor is a destructor.
func (d *Destructor) GoString() string
func (d *Destructor) Traverse(fn func(AST) bool)
ExprList is a list of expressions, typically arguments to a function call in an expression.
FixedType is a fixed numeric type of unknown size.
Fold is a C++17 fold-expression. Arg2 is nil for a unary operator.
FunctionParam is a parameter of a function, used for last-specified return type in a closure.
func (fp *FunctionParam) GoString() string
func (fp *FunctionParam) Traverse(fn func(AST) bool)
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 (ft *FunctionType) GoString() string
func (ft *FunctionType) Traverse(fn func(AST) bool)
GlobalCDtor is a global constructor or destructor.
func (gcd *GlobalCDtor) GoString() string
func (gcd *GlobalCDtor) Traverse(fn func(AST) bool)
ImaginaryType is an imaginary type.
func (it *ImaginaryType) GoString() string
func (it *ImaginaryType) Traverse(fn func(AST) bool)
InitializerList is an initializer list: an optional type with a list of expressions.
func (il *InitializerList) GoString() string
func (il *InitializerList) Traverse(fn func(AST) bool)
Literal is a literal in an expression.
type MethodWithQualifiers struct { Method AST Qualifiers Qualifiers RefQualifier string // "" or "&" or "&&" }
MethodWithQualifiers is a method with qualifiers.
func (mwq *MethodWithQualifiers) GoString() string
func (mwq *MethodWithQualifiers) Traverse(fn func(AST) bool)
Name is an unqualified name.
New is a use of operator new in an expression.
Nullary is an operator in an expression with no arguments, such as throw.
Operator is an operator.
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 struct { Base AST Pack *ArgumentPack }
PackExpansion is a pack expansion. The Pack field may be nil.
func (pe *PackExpansion) GoString() string
func (pe *PackExpansion) Traverse(fn func(AST) bool)
PointerType is a pointer type.
func (pt *PointerType) GoString() string
func (pt *PointerType) Traverse(fn func(AST) bool)
PtrMem is a pointer-to-member expression.
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.
Qualifiers is an ordered list of type qualifiers.
ReferenceType is a reference type.
func (rt *ReferenceType) GoString() string
func (rt *ReferenceType) Traverse(fn func(AST) bool)
RvalueReferenceType is an rvalue reference type.
func (rt *RvalueReferenceType) GoString() string
func (rt *RvalueReferenceType) Traverse(fn func(AST) bool)
SizeofArgs is the size of a captured template parameter pack from an alias template.
func (sa *SizeofArgs) GoString() string
func (sa *SizeofArgs) Traverse(fn func(AST) bool)
type SizeofPack struct { Pack *ArgumentPack }
SizeofPack is the sizeof operator applied to an argument pack.
func (sp *SizeofPack) GoString() string
func (sp *SizeofPack) Traverse(fn func(AST) bool)
Special is a special symbol, printed as a prefix plus another value.
Special2 is like special, but uses two values.
TaggedName is a name with an ABI tag.
func (t *TaggedName) GoString() string
func (t *TaggedName) Traverse(fn func(AST) bool)
Template is a template with arguments.
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 (tp *TemplateParam) GoString() string
func (tp *TemplateParam) Traverse(fn func(AST) bool)
Trinary is the ?: trinary operation in an expression.
type TypeWithQualifiers struct { Base AST Qualifiers Qualifiers }
TypeWithQualifiers is a type with standard qualifiers.
func (twq *TypeWithQualifiers) GoString() string
func (twq *TypeWithQualifiers) Traverse(fn func(AST) bool)
Typed is a typed name.
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.
UnnamedType is an unnamed type, that just has an index.
func (ut *UnnamedType) GoString() string
func (ut *UnnamedType) Traverse(fn func(AST) bool)
VectorType is a vector type.
func (vt *VectorType) GoString() string
func (vt *VectorType) Traverse(fn func(AST) bool)
VendorQualifier is a type qualified by a vendor-specific qualifier.
func (vq *VendorQualifier) GoString() string
func (vq *VendorQualifier) Traverse(fn func(AST) bool)
Package demangle imports 4 packages (graph). Updated 2021-01-21. Refresh now. Tools for package owners.