Lines Matching refs:Name
1 //===--- ItaniumMangle.cpp - Itanium C++ Name Mangling ----------*- C++ -*-===//
10 // Implements C++ name mangling according to the Itanium C++ ABI,
134 /// @name Mangler Entry Points
211 /// Manage the mangling of a single name.
293 assert(status == 0 && "Could not demangle mangled name!");
318 void mangleExistingSubstitution(TemplateName name);
334 DeclarationName name,
343 void mangleUnqualifiedName(const NamedDecl *ND, DeclarationName Name,
365 void mangleOperatorName(DeclarationName Name, unsigned Arity);
390 DeclarationName name,
458 // <mangled-name> ::= _Z <encoding>
459 // ::= <data name>
460 // ::= <special-name>
473 // <encoding> ::= <function name> <bare-function-type>
505 // 2. Function types not appearing as part of a function name mangling,
584 // <name> ::= <nested-name>
585 // ::= <unscoped-name>
586 // ::= <unscoped-template-name> <template-args>
587 // ::= <local-name>
639 // <unscoped-name> ::= <unqualified-name>
640 // ::= St <unqualified-name> # ::std::
649 // <unscoped-template-name> ::= <unscoped-name>
664 // <unscoped-template-name> ::= <unscoped-name>
673 assert(Dependent && "Not a dependent template name?");
770 // the template in question is a dependent template name. Should we
783 // the template in question is a dependent template name. Should we
795 /// Mangle everything prior to the base-unresolved-name in an unresolved-name.
803 // <unresolved-name> ::= [gs] <base-unresolved-name>
806 // <unresolved-name> ::= sr <unresolved-type> <base-unresolved-name>
809 // <unresolved-name> ::= srN <unresolved-type> <unresolved-qualifier-level>+ E
810 // <base-unresolved-name>
813 // <unresolved-name> ::= [gs] sr <unresolved-qualifier-level>+ E
814 // <base-unresolved-name>
888 /// Mangle an unresolved-name, which is generally used for names which
891 DeclarationName name,
894 switch (name.getNameKind()) {
895 // <base-unresolved-name> ::= <simple-id>
897 mangleSourceName(name.getAsIdentifierInfo());
899 // <base-unresolved-name> ::= dn <destructor-name>
902 mangleUnresolvedTypeOrSimpleId(name.getCXXNameType());
904 // <base-unresolved-name> ::= on <operator-name>
909 mangleOperatorName(name, knownArity);
912 llvm_unreachable("Can't mangle a constructor name!");
914 llvm_unreachable("Can't mangle a using directive name!");
923 DeclarationName Name,
926 // <unqualified-name> ::= <operator-name>
927 // ::= <ctor-dtor-name>
928 // ::= <source-name>
929 switch (Name.getNameKind()) {
931 if (const IdentifierInfo *II = Name.getAsIdentifierInfo()) {
947 assert(ND && "mangling empty name without declaration");
964 // For the purposes of mangling, the name of an anonymous union is
965 // considered to be the name of the first named data member found by a
970 // need to mangle its name.
977 // doesn't really matter what name we generate.
979 assert(FD->getIdentifier() && "Data member name isn't an identifier!");
985 // Class extensions have no name as a category, and it's possible
988 // declarations will always have internal linkage, so the name
1005 // <unnamed-type-name> ::= <closure-type-name>
1007 // <closure-type-name> ::= Ul <lambda-sig> E [ <nonnegative number> ] _
1028 // Mangle it as a source name in the form
1051 // Otherwise, use the complete constructor name. This is relevant if a
1062 // Otherwise, use the complete destructor name. This is relevant if a
1079 mangleOperatorName(Name, Arity);
1083 llvm_unreachable("Can't mangle a using directive name!");
1088 // <source-name> ::= <positive length number> <identifier>
1097 // <nested-name>
1098 // ::= N [<CV-qualifiers>] [<ref-qualifier>] <prefix> <unqualified-name> E
1129 // <nested-name> ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
1140 // <local-name> := Z <function encoding> E <entity name> [<discriminator>]
1142 // <local-name> := Z <function encoding> E d [ <parameter number> ]
1143 // _ <entity name>
1163 // <entity name> will of course contain a <closure-type-name>: Its
1181 // Mangle the name relative to the closest enclosing function.
1241 if (const IdentifierInfo *Name
1243 mangleSourceName(Name);
1263 // (static or nonstatic), it is encoded in a qualified name with a final
1266 // <data-member-prefix> := <member source-name> M
1274 if (const IdentifierInfo *Name
1276 mangleSourceName(Name);
1333 llvm_unreachable("unexpected nested name specifier");
1337 // <prefix> ::= <prefix> <unqualified-name>
1371 // <template-prefix> ::= <prefix> <template unqualified-name>
1388 assert(Dependent && "Unknown template name kind?");
1396 // <template-prefix> ::= <prefix> <template unqualified-name>
1416 /// Mangles a template name under the production <type>. Required for
1444 llvm_unreachable("can't mangle an overloaded template name as a <type>");
1450 // <class-enum-type> ::= <name>
1451 // <name> ::= <nested-name>
1511 llvm_unreachable("type is illegal as a nested name specifier");
1626 void CXXNameMangler::mangleOperatorName(DeclarationName Name, unsigned Arity) {
1627 switch (Name.getNameKind()) {
1635 llvm_unreachable("Not an operator name");
1638 // <operator-name> ::= cv <type> # (cast)
1640 mangleType(Name.getCXXNameType());
1645 mangleSourceName(Name.getCXXLiteralIdentifier());
1649 mangleOperatorName(Name.getCXXOverloadedOperator(), Arity);
1659 // <operator-name> ::= nw # new
1881 // FIXME: This is an approximation of the instantiation-dependent name
1990 // ::= u <source-name> # vendor extended type
2221 // <class-enum-type> ::= <name>
2227 // <class-enum-type> ::= <name>
2420 // the equivalent internal name. The vector type must be one of the special
2516 StringRef name = I->getName();
2517 QualOS << name.size() << name;
2539 // Mangle injected class name types as if the user had written the
2555 // the template in question is a dependent template name. Should we
2564 // <class-enum-type> ::= <name> # non-dependent or dependent type name or
2567 // ::= Ts <name> # dependent elaborated type specifier using
2569 // ::= Tu <name> # dependent elaborated type specifier using
2571 // ::= Te <name> # dependent elaborated type specifier using
2588 llvm_unreachable("unexpected keyword for dependent type name");
2608 // the template in question is a dependent template name. Should we
2678 // <type> ::= U <source-name> <type> # vendor extended type qualifier
2730 // <expression> ::= dt <expression> <unresolved-name>
2731 // ::= pt <expression> <unresolved-name>
2783 // <expression> ::= <unary operator-name> <expression>
2784 // ::= <binary operator-name> <expression> <expression>
2785 // ::= <trinary operator-name> <expression> <expression> <expression>
2796 // ::= sr <type> <unqualified-name> # dependent name
2797 // ::= sr <type> <unqualified-name> <template-args> # dependent template-id
2804 // ::= L <mangled-name> E # external name
3017 // <base-unresolved-name> ::= dn <destructor-name>
3058 // All the <unresolved-name> productions end in a
3059 // base-unresolved-name, where <template-args> are just tacked
3333 // <expr-primary> ::= L <mangled-name> E # external name
3380 // All the <unresolved-name> productions end in a
3381 // base-unresolved-name, where <template-args> are just tacked
3610 // <ctor-dtor-name> ::= C1 # complete object constructor
3613 // In addition, C5 is a comdat name with C1 and C2 in it.
3631 // <ctor-dtor-name> ::= D0 # deleting destructor
3635 // In addition, D5 is a comdat name with D1, D2 and, if virtual, D0 in it.
3726 // <expr-primary> ::= L <mangled-name> E # external name
3738 // References to external entities use the mangled name; if the name would
3803 assert(result && "no existing substitution for template name");
3865 /// Returns whether a given type is a template specialization of a given name
3867 static bool isCharSpecialization(QualType T, const char *Name) {
3890 return SD->getIdentifier()->getName() == Name;
4016 /// Mangles the name of the declaration D and emits that name to the given
4019 /// If the declaration D requires a mangled name, this routine will emit that
4020 /// mangled name to \p os and return true. Otherwise, \p os will be unchanged
4023 /// name.
4068 // <special-name> ::= T <call-offset> <base encoding>
4070 // <special-name> ::= Tc <call-offset> <call-offset> <base encoding>
4097 // <special-name> ::= T <call-offset> <base encoding>
4109 /// Returns the mangled name for a guard variable for the passed in VarDecl.
4112 // <special-name> ::= GV <object name> # Guard variable for one-time
4160 // <special-name> ::= TH <object name>
4169 // <special-name> ::= TW <object name>
4179 // <special-name> ::= GR <object name>
4189 // <special-name> ::= TV <type> # virtual table
4197 // <special-name> ::= TT <type> # VTT structure
4207 // <special-name> ::= TC <type> <offset number> _ <base type>
4217 // <special-name> ::= TI <type> # typeinfo structure
4226 // <special-name> ::= TS <type> # typeinfo name (null terminated byte string)