Lines Matching refs:MangledName
69 static bool isMemberPointer(std::string_view MangledName, bool &Error) { in isMemberPointer() argument
71 const char F = MangledName.front(); in isMemberPointer()
72 MangledName.remove_prefix(1); in isMemberPointer()
97 if (startsWithDigit(MangledName)) { in isMemberPointer()
98 if (MangledName[0] != '6' && MangledName[0] != '8') { in isMemberPointer()
102 return (MangledName[0] == '8'); in isMemberPointer()
107 consumeFront(MangledName, 'E'); // 64-bit in isMemberPointer()
108 consumeFront(MangledName, 'I'); // restrict in isMemberPointer()
109 consumeFront(MangledName, 'F'); // unaligned in isMemberPointer()
111 if (MangledName.empty()) { in isMemberPointer()
117 switch (MangledName.front()) { in isMemberPointer()
135 consumeSpecialIntrinsicKind(std::string_view &MangledName) { in consumeSpecialIntrinsicKind() argument
136 if (consumeFront(MangledName, "?_7")) in consumeSpecialIntrinsicKind()
138 if (consumeFront(MangledName, "?_8")) in consumeSpecialIntrinsicKind()
140 if (consumeFront(MangledName, "?_9")) in consumeSpecialIntrinsicKind()
142 if (consumeFront(MangledName, "?_A")) in consumeSpecialIntrinsicKind()
144 if (consumeFront(MangledName, "?_B")) in consumeSpecialIntrinsicKind()
146 if (consumeFront(MangledName, "?_C")) in consumeSpecialIntrinsicKind()
148 if (consumeFront(MangledName, "?_P")) in consumeSpecialIntrinsicKind()
150 if (consumeFront(MangledName, "?_R0")) in consumeSpecialIntrinsicKind()
152 if (consumeFront(MangledName, "?_R1")) in consumeSpecialIntrinsicKind()
154 if (consumeFront(MangledName, "?_R2")) in consumeSpecialIntrinsicKind()
156 if (consumeFront(MangledName, "?_R3")) in consumeSpecialIntrinsicKind()
158 if (consumeFront(MangledName, "?_R4")) in consumeSpecialIntrinsicKind()
160 if (consumeFront(MangledName, "?_S")) in consumeSpecialIntrinsicKind()
162 if (consumeFront(MangledName, "?__E")) in consumeSpecialIntrinsicKind()
164 if (consumeFront(MangledName, "?__F")) in consumeSpecialIntrinsicKind()
166 if (consumeFront(MangledName, "?__J")) in consumeSpecialIntrinsicKind()
246 demangleFunctionRefQualifier(std::string_view &MangledName) { in demangleFunctionRefQualifier() argument
247 if (consumeFront(MangledName, 'G')) in demangleFunctionRefQualifier()
249 else if (consumeFront(MangledName, 'H')) in demangleFunctionRefQualifier()
255 demanglePointerCVQualifiers(std::string_view &MangledName) { in demanglePointerCVQualifiers() argument
256 if (consumeFront(MangledName, "$$Q")) in demanglePointerCVQualifiers()
259 const char F = MangledName.front(); in demanglePointerCVQualifiers()
260 MangledName.remove_prefix(1); in demanglePointerCVQualifiers()
290 Demangler::demangleSpecialTableSymbolNode(std::string_view &MangledName, in demangleSpecialTableSymbolNode() argument
309 QualifiedNameNode *QN = demangleNameScopeChain(MangledName, NI); in demangleSpecialTableSymbolNode()
313 if (MangledName.empty()) { in demangleSpecialTableSymbolNode()
317 char Front = MangledName.front(); in demangleSpecialTableSymbolNode()
318 MangledName.remove_prefix(1); in demangleSpecialTableSymbolNode()
324 std::tie(STSN->Quals, IsMember) = demangleQualifiers(MangledName); in demangleSpecialTableSymbolNode()
325 if (!consumeFront(MangledName, '@')) in demangleSpecialTableSymbolNode()
326 STSN->TargetName = demangleFullyQualifiedTypeName(MangledName); in demangleSpecialTableSymbolNode()
331 Demangler::demangleLocalStaticGuard(std::string_view &MangledName, in demangleLocalStaticGuard() argument
336 QualifiedNameNode *QN = demangleNameScopeChain(MangledName, LSGI); in demangleLocalStaticGuard()
341 if (consumeFront(MangledName, "4IA")) in demangleLocalStaticGuard()
343 else if (consumeFront(MangledName, "5")) in demangleLocalStaticGuard()
350 if (!MangledName.empty()) in demangleLocalStaticGuard()
351 LSGI->ScopeIndex = demangleUnsigned(MangledName); in demangleLocalStaticGuard()
389 std::string_view &MangledName, in demangleUntypedVariable() argument
392 QualifiedNameNode *QN = demangleNameScopeChain(MangledName, NI); in demangleUntypedVariable()
395 if (consumeFront(MangledName, "8")) in demangleUntypedVariable()
404 std::string_view &MangledName) { in demangleRttiBaseClassDescriptorNode() argument
407 RBCDN->NVOffset = demangleUnsigned(MangledName); in demangleRttiBaseClassDescriptorNode()
408 RBCDN->VBPtrOffset = demangleSigned(MangledName); in demangleRttiBaseClassDescriptorNode()
409 RBCDN->VBTableOffset = demangleUnsigned(MangledName); in demangleRttiBaseClassDescriptorNode()
410 RBCDN->Flags = demangleUnsigned(MangledName); in demangleRttiBaseClassDescriptorNode()
415 VSN->Name = demangleNameScopeChain(MangledName, RBCDN); in demangleRttiBaseClassDescriptorNode()
416 consumeFront(MangledName, '8'); in demangleRttiBaseClassDescriptorNode()
421 Demangler::demangleInitFiniStub(std::string_view &MangledName, in demangleInitFiniStub() argument
428 if (consumeFront(MangledName, '?')) in demangleInitFiniStub()
431 SymbolNode *Symbol = demangleDeclarator(MangledName); in demangleInitFiniStub()
446 if (consumeFront(MangledName, '@')) in demangleInitFiniStub()
452 FSN = demangleFunctionEncoding(MangledName); in demangleInitFiniStub()
470 SymbolNode *Demangler::demangleSpecialIntrinsic(std::string_view &MangledName) { in demangleSpecialIntrinsic() argument
471 SpecialIntrinsicKind SIK = consumeSpecialIntrinsicKind(MangledName); in demangleSpecialIntrinsic()
477 return demangleStringLiteral(MangledName); in demangleSpecialIntrinsic()
482 return demangleSpecialTableSymbolNode(MangledName, SIK); in demangleSpecialIntrinsic()
484 return demangleVcallThunkNode(MangledName); in demangleSpecialIntrinsic()
486 return demangleLocalStaticGuard(MangledName, /*IsThread=*/false); in demangleSpecialIntrinsic()
488 return demangleLocalStaticGuard(MangledName, /*IsThread=*/true); in demangleSpecialIntrinsic()
490 TypeNode *T = demangleType(MangledName, QualifierMangleMode::Result); in demangleSpecialIntrinsic()
493 if (!consumeFront(MangledName, "@8")) in demangleSpecialIntrinsic()
495 if (!MangledName.empty()) in demangleSpecialIntrinsic()
500 return demangleUntypedVariable(Arena, MangledName, in demangleSpecialIntrinsic()
503 return demangleUntypedVariable(Arena, MangledName, in demangleSpecialIntrinsic()
506 return demangleRttiBaseClassDescriptorNode(Arena, MangledName); in demangleSpecialIntrinsic()
508 return demangleInitFiniStub(MangledName, /*IsDestructor=*/false); in demangleSpecialIntrinsic()
510 return demangleInitFiniStub(MangledName, /*IsDestructor=*/true); in demangleSpecialIntrinsic()
524 Demangler::demangleFunctionIdentifierCode(std::string_view &MangledName) { in demangleFunctionIdentifierCode() argument
525 assert(llvm::itanium_demangle::starts_with(MangledName, '?')); in demangleFunctionIdentifierCode()
526 MangledName.remove_prefix(1); in demangleFunctionIdentifierCode()
527 if (MangledName.empty()) { in demangleFunctionIdentifierCode()
532 if (consumeFront(MangledName, "__")) in demangleFunctionIdentifierCode()
534 MangledName, FunctionIdentifierCodeGroup::DoubleUnder); in demangleFunctionIdentifierCode()
535 if (consumeFront(MangledName, "_")) in demangleFunctionIdentifierCode()
536 return demangleFunctionIdentifierCode(MangledName, in demangleFunctionIdentifierCode()
538 return demangleFunctionIdentifierCode(MangledName, in demangleFunctionIdentifierCode()
543 Demangler::demangleStructorIdentifier(std::string_view &MangledName, in demangleStructorIdentifier() argument
551 Demangler::demangleConversionOperatorIdentifier(std::string_view &MangledName) { in demangleConversionOperatorIdentifier() argument
558 Demangler::demangleLiteralOperatorIdentifier(std::string_view &MangledName) { in demangleLiteralOperatorIdentifier() argument
561 N->Name = demangleSimpleString(MangledName, /*Memorize=*/false); in demangleLiteralOperatorIdentifier()
706 Demangler::demangleFunctionIdentifierCode(std::string_view &MangledName, in demangleFunctionIdentifierCode() argument
708 if (MangledName.empty()) { in demangleFunctionIdentifierCode()
712 const char CH = MangledName.front(); in demangleFunctionIdentifierCode()
715 MangledName.remove_prefix(1); in demangleFunctionIdentifierCode()
719 return demangleStructorIdentifier(MangledName, CH == '1'); in demangleFunctionIdentifierCode()
721 return demangleConversionOperatorIdentifier(MangledName); in demangleFunctionIdentifierCode()
727 MangledName.remove_prefix(1); in demangleFunctionIdentifierCode()
731 MangledName.remove_prefix(1); in demangleFunctionIdentifierCode()
734 return demangleLiteralOperatorIdentifier(MangledName); in demangleFunctionIdentifierCode()
744 SymbolNode *Demangler::demangleEncodedSymbol(std::string_view &MangledName, in demangleEncodedSymbol() argument
746 if (MangledName.empty()) { in demangleEncodedSymbol()
752 switch (MangledName.front()) { in demangleEncodedSymbol()
758 StorageClass SC = demangleVariableStorageClass(MangledName); in demangleEncodedSymbol()
759 return demangleVariableEncoding(MangledName, SC); in demangleEncodedSymbol()
762 FunctionSymbolNode *FSN = demangleFunctionEncoding(MangledName); in demangleEncodedSymbol()
774 SymbolNode *Demangler::demangleDeclarator(std::string_view &MangledName) { in demangleDeclarator() argument
777 QualifiedNameNode *QN = demangleFullyQualifiedSymbolName(MangledName); in demangleDeclarator()
781 SymbolNode *Symbol = demangleEncodedSymbol(MangledName, QN); in demangleDeclarator()
798 SymbolNode *Demangler::demangleMD5Name(std::string_view &MangledName) { in demangleMD5Name() argument
799 assert(llvm::itanium_demangle::starts_with(MangledName, "??@")); in demangleMD5Name()
803 size_t MD5Last = MangledName.find('@', strlen("??@")); in demangleMD5Name()
808 const char *Start = MangledName.data(); in demangleMD5Name()
809 const size_t StartSize = MangledName.size(); in demangleMD5Name()
810 MangledName.remove_prefix(MD5Last + 1); in demangleMD5Name()
822 consumeFront(MangledName, "??_R4@"); in demangleMD5Name()
824 assert(MangledName.size() < StartSize); in demangleMD5Name()
825 const size_t Count = StartSize - MangledName.size(); in demangleMD5Name()
833 SymbolNode *Demangler::demangleTypeinfoName(std::string_view &MangledName) { in demangleTypeinfoName() argument
834 assert(llvm::itanium_demangle::starts_with(MangledName, '.')); in demangleTypeinfoName()
835 consumeFront(MangledName, '.'); in demangleTypeinfoName()
837 TypeNode *T = demangleType(MangledName, QualifierMangleMode::Result); in demangleTypeinfoName()
838 if (Error || !MangledName.empty()) { in demangleTypeinfoName()
846 SymbolNode *Demangler::parse(std::string_view &MangledName) { in parse() argument
850 if (llvm::itanium_demangle::starts_with(MangledName, '.')) in parse()
851 return demangleTypeinfoName(MangledName); in parse()
853 if (llvm::itanium_demangle::starts_with(MangledName, "??@")) in parse()
854 return demangleMD5Name(MangledName); in parse()
857 if (!llvm::itanium_demangle::starts_with(MangledName, '?')) { in parse()
862 consumeFront(MangledName, '?'); in parse()
866 if (SymbolNode *SI = demangleSpecialIntrinsic(MangledName)) in parse()
869 return demangleDeclarator(MangledName); in parse()
872 TagTypeNode *Demangler::parseTagUniqueName(std::string_view &MangledName) { in parseTagUniqueName() argument
873 if (!consumeFront(MangledName, ".?A")) { in parseTagUniqueName()
877 consumeFront(MangledName, ".?A"); in parseTagUniqueName()
878 if (MangledName.empty()) { in parseTagUniqueName()
883 return demangleClassType(MangledName); in parseTagUniqueName()
894 Demangler::demangleVariableEncoding(std::string_view &MangledName, in demangleVariableEncoding() argument
898 VSN->Type = demangleType(MangledName, QualifierMangleMode::Drop); in demangleVariableEncoding()
912 demanglePointerExtQualifiers(MangledName)); in demangleVariableEncoding()
915 std::tie(ExtraChildQuals, IsMember) = demangleQualifiers(MangledName); in demangleVariableEncoding()
919 demangleFullyQualifiedTypeName(MangledName); in demangleVariableEncoding()
927 VSN->Type->Quals = demangleQualifiers(MangledName).first; in demangleVariableEncoding()
946 Demangler::demangleNumber(std::string_view &MangledName) { in demangleNumber() argument
947 bool IsNegative = consumeFront(MangledName, '?'); in demangleNumber()
949 if (startsWithDigit(MangledName)) { in demangleNumber()
950 uint64_t Ret = MangledName[0] - '0' + 1; in demangleNumber()
951 MangledName.remove_prefix(1); in demangleNumber()
956 for (size_t i = 0; i < MangledName.size(); ++i) { in demangleNumber()
957 char C = MangledName[i]; in demangleNumber()
959 MangledName.remove_prefix(i + 1); in demangleNumber()
973 uint64_t Demangler::demangleUnsigned(std::string_view &MangledName) { in demangleUnsigned() argument
976 std::tie(Number, IsNegative) = demangleNumber(MangledName); in demangleUnsigned()
982 int64_t Demangler::demangleSigned(std::string_view &MangledName) { in demangleSigned() argument
985 std::tie(Number, IsNegative) = demangleNumber(MangledName); in demangleSigned()
1006 Demangler::demangleBackRefName(std::string_view &MangledName) { in demangleBackRefName() argument
1007 assert(startsWithDigit(MangledName)); in demangleBackRefName()
1009 size_t I = MangledName[0] - '0'; in demangleBackRefName()
1015 MangledName.remove_prefix(1); in demangleBackRefName()
1030 Demangler::demangleTemplateInstantiationName(std::string_view &MangledName, in demangleTemplateInstantiationName() argument
1032 assert(llvm::itanium_demangle::starts_with(MangledName, "?$")); in demangleTemplateInstantiationName()
1033 consumeFront(MangledName, "?$"); in demangleTemplateInstantiationName()
1039 demangleUnqualifiedSymbolName(MangledName, NBB_Simple); in demangleTemplateInstantiationName()
1041 Identifier->TemplateParams = demangleTemplateParameterList(MangledName); in demangleTemplateInstantiationName()
1064 Demangler::demangleSimpleName(std::string_view &MangledName, bool Memorize) { in demangleSimpleName() argument
1065 std::string_view S = demangleSimpleString(MangledName, Memorize); in demangleSimpleName()
1081 uint8_t Demangler::demangleCharLiteral(std::string_view &MangledName) { in demangleCharLiteral() argument
1082 assert(!MangledName.empty()); in demangleCharLiteral()
1083 if (!llvm::itanium_demangle::starts_with(MangledName, '?')) { in demangleCharLiteral()
1084 const uint8_t F = MangledName.front(); in demangleCharLiteral()
1085 MangledName.remove_prefix(1); in demangleCharLiteral()
1089 MangledName.remove_prefix(1); in demangleCharLiteral()
1090 if (MangledName.empty()) in demangleCharLiteral()
1093 if (consumeFront(MangledName, '$')) { in demangleCharLiteral()
1095 if (MangledName.size() < 2) in demangleCharLiteral()
1097 std::string_view Nibbles = MangledName.substr(0, 2); in demangleCharLiteral()
1103 MangledName.remove_prefix(2); in demangleCharLiteral()
1107 if (startsWithDigit(MangledName)) { in demangleCharLiteral()
1109 char C = Lookup[MangledName[0] - '0']; in demangleCharLiteral()
1110 MangledName.remove_prefix(1); in demangleCharLiteral()
1114 if (MangledName[0] >= 'a' && MangledName[0] <= 'z') { in demangleCharLiteral()
1119 char C = Lookup[MangledName[0] - 'a']; in demangleCharLiteral()
1120 MangledName.remove_prefix(1); in demangleCharLiteral()
1124 if (MangledName[0] >= 'A' && MangledName[0] <= 'Z') { in demangleCharLiteral()
1129 char C = Lookup[MangledName[0] - 'A']; in demangleCharLiteral()
1130 MangledName.remove_prefix(1); in demangleCharLiteral()
1139 wchar_t Demangler::demangleWcharLiteral(std::string_view &MangledName) { in demangleWcharLiteral() argument
1142 C1 = demangleCharLiteral(MangledName); in demangleWcharLiteral()
1143 if (Error || MangledName.empty()) in demangleWcharLiteral()
1145 C2 = demangleCharLiteral(MangledName); in demangleWcharLiteral()
1307 Demangler::demangleVcallThunkNode(std::string_view &MangledName) { in demangleVcallThunkNode() argument
1313 FSN->Name = demangleNameScopeChain(MangledName, VTIN); in demangleVcallThunkNode()
1315 Error = !consumeFront(MangledName, "$B"); in demangleVcallThunkNode()
1317 VTIN->OffsetInVTable = demangleUnsigned(MangledName); in demangleVcallThunkNode()
1319 Error = !consumeFront(MangledName, 'A'); in demangleVcallThunkNode()
1321 FSN->Signature->CallConvention = demangleCallingConvention(MangledName); in demangleVcallThunkNode()
1326 Demangler::demangleStringLiteral(std::string_view &MangledName) { in demangleStringLiteral() argument
1339 if (!consumeFront(MangledName, "@_")) in demangleStringLiteral()
1341 if (MangledName.empty()) in demangleStringLiteral()
1345 F = MangledName.front(); in demangleStringLiteral()
1346 MangledName.remove_prefix(1); in demangleStringLiteral()
1358 std::tie(StringByteSize, IsNegative) = demangleNumber(MangledName); in demangleStringLiteral()
1363 CrcEndPos = MangledName.find('@'); in demangleStringLiteral()
1366 CRC = MangledName.substr(0, CrcEndPos); in demangleStringLiteral()
1367 MangledName.remove_prefix(CrcEndPos + 1); in demangleStringLiteral()
1368 if (MangledName.empty()) in demangleStringLiteral()
1376 while (!consumeFront(MangledName, '@')) { in demangleStringLiteral()
1377 if (MangledName.size() < 2) in demangleStringLiteral()
1379 wchar_t W = demangleWcharLiteral(MangledName); in demangleStringLiteral()
1393 while (!consumeFront(MangledName, '@')) { in demangleStringLiteral()
1394 if (MangledName.size() < 1 || BytesDecoded >= MaxStringByteLength) in demangleStringLiteral()
1396 StringBytes[BytesDecoded++] = demangleCharLiteral(MangledName); in demangleStringLiteral()
1439 std::string_view Demangler::demangleSimpleString(std::string_view &MangledName, in demangleSimpleString() argument
1442 for (size_t i = 0; i < MangledName.size(); ++i) { in demangleSimpleString()
1443 if (MangledName[i] != '@') in demangleSimpleString()
1447 S = MangledName.substr(0, i); in demangleSimpleString()
1448 MangledName.remove_prefix(i + 1); in demangleSimpleString()
1460 Demangler::demangleAnonymousNamespaceName(std::string_view &MangledName) { in demangleAnonymousNamespaceName() argument
1461 assert(llvm::itanium_demangle::starts_with(MangledName, "?A")); in demangleAnonymousNamespaceName()
1462 consumeFront(MangledName, "?A"); in demangleAnonymousNamespaceName()
1466 size_t EndPos = MangledName.find('@'); in demangleAnonymousNamespaceName()
1471 std::string_view NamespaceKey = MangledName.substr(0, EndPos); in demangleAnonymousNamespaceName()
1473 MangledName = MangledName.substr(EndPos + 1); in demangleAnonymousNamespaceName()
1478 Demangler::demangleLocallyScopedNamePiece(std::string_view &MangledName) { in demangleLocallyScopedNamePiece() argument
1479 assert(startsWithLocalScopePattern(MangledName)); in demangleLocallyScopedNamePiece()
1482 consumeFront(MangledName, '?'); in demangleLocallyScopedNamePiece()
1485 std::tie(Number, IsNegative) = demangleNumber(MangledName); in demangleLocallyScopedNamePiece()
1489 consumeFront(MangledName, '?'); in demangleLocallyScopedNamePiece()
1492 Node *Scope = parse(MangledName); in demangleLocallyScopedNamePiece()
1510 Demangler::demangleFullyQualifiedTypeName(std::string_view &MangledName) { in demangleFullyQualifiedTypeName() argument
1512 demangleUnqualifiedTypeName(MangledName, /*Memorize=*/true); in demangleFullyQualifiedTypeName()
1517 QualifiedNameNode *QN = demangleNameScopeChain(MangledName, Identifier); in demangleFullyQualifiedTypeName()
1528 Demangler::demangleFullyQualifiedSymbolName(std::string_view &MangledName) { in demangleFullyQualifiedSymbolName() argument
1535 demangleUnqualifiedSymbolName(MangledName, NBB_Simple); in demangleFullyQualifiedSymbolName()
1539 QualifiedNameNode *QN = demangleNameScopeChain(MangledName, Identifier); in demangleFullyQualifiedSymbolName()
1558 Demangler::demangleUnqualifiedTypeName(std::string_view &MangledName, in demangleUnqualifiedTypeName() argument
1564 if (startsWithDigit(MangledName)) in demangleUnqualifiedTypeName()
1565 return demangleBackRefName(MangledName); in demangleUnqualifiedTypeName()
1567 if (llvm::itanium_demangle::starts_with(MangledName, "?$")) in demangleUnqualifiedTypeName()
1568 return demangleTemplateInstantiationName(MangledName, NBB_Template); in demangleUnqualifiedTypeName()
1570 return demangleSimpleName(MangledName, Memorize); in demangleUnqualifiedTypeName()
1574 Demangler::demangleUnqualifiedSymbolName(std::string_view &MangledName, in demangleUnqualifiedSymbolName() argument
1576 if (startsWithDigit(MangledName)) in demangleUnqualifiedSymbolName()
1577 return demangleBackRefName(MangledName); in demangleUnqualifiedSymbolName()
1578 if (llvm::itanium_demangle::starts_with(MangledName, "?$")) in demangleUnqualifiedSymbolName()
1579 return demangleTemplateInstantiationName(MangledName, NBB); in demangleUnqualifiedSymbolName()
1580 if (llvm::itanium_demangle::starts_with(MangledName, '?')) in demangleUnqualifiedSymbolName()
1581 return demangleFunctionIdentifierCode(MangledName); in demangleUnqualifiedSymbolName()
1582 return demangleSimpleName(MangledName, /*Memorize=*/(NBB & NBB_Simple) != 0); in demangleUnqualifiedSymbolName()
1586 Demangler::demangleNameScopePiece(std::string_view &MangledName) { in demangleNameScopePiece() argument
1587 if (startsWithDigit(MangledName)) in demangleNameScopePiece()
1588 return demangleBackRefName(MangledName); in demangleNameScopePiece()
1590 if (llvm::itanium_demangle::starts_with(MangledName, "?$")) in demangleNameScopePiece()
1591 return demangleTemplateInstantiationName(MangledName, NBB_Template); in demangleNameScopePiece()
1593 if (llvm::itanium_demangle::starts_with(MangledName, "?A")) in demangleNameScopePiece()
1594 return demangleAnonymousNamespaceName(MangledName); in demangleNameScopePiece()
1596 if (startsWithLocalScopePattern(MangledName)) in demangleNameScopePiece()
1597 return demangleLocallyScopedNamePiece(MangledName); in demangleNameScopePiece()
1599 return demangleSimpleName(MangledName, /*Memorize=*/true); in demangleNameScopePiece()
1615 Demangler::demangleNameScopeChain(std::string_view &MangledName, in demangleNameScopeChain() argument
1622 while (!consumeFront(MangledName, "@")) { in demangleNameScopeChain()
1628 if (MangledName.empty()) { in demangleNameScopeChain()
1634 IdentifierNode *Elem = demangleNameScopePiece(MangledName); in demangleNameScopeChain()
1646 FuncClass Demangler::demangleFunctionClass(std::string_view &MangledName) { in demangleFunctionClass() argument
1647 const char F = MangledName.front(); in demangleFunctionClass()
1648 MangledName.remove_prefix(1); in demangleFunctionClass()
1706 if (consumeFront(MangledName, 'R')) in demangleFunctionClass()
1708 if (MangledName.empty()) in demangleFunctionClass()
1710 const char F = MangledName.front(); in demangleFunctionClass()
1711 MangledName.remove_prefix(1); in demangleFunctionClass()
1734 Demangler::demangleCallingConvention(std::string_view &MangledName) { in demangleCallingConvention() argument
1735 if (MangledName.empty()) { in demangleCallingConvention()
1740 const char F = MangledName.front(); in demangleCallingConvention()
1741 MangledName.remove_prefix(1); in demangleCallingConvention()
1776 Demangler::demangleVariableStorageClass(std::string_view &MangledName) { in demangleVariableStorageClass() argument
1777 assert(MangledName.front() >= '0' && MangledName.front() <= '4'); in demangleVariableStorageClass()
1779 const char F = MangledName.front(); in demangleVariableStorageClass()
1780 MangledName.remove_prefix(1); in demangleVariableStorageClass()
1797 Demangler::demangleQualifiers(std::string_view &MangledName) { in demangleQualifiers() argument
1798 if (MangledName.empty()) { in demangleQualifiers()
1803 const char F = MangledName.front(); in demangleQualifiers()
1804 MangledName.remove_prefix(1); in demangleQualifiers()
1831 TypeNode *Demangler::demangleType(std::string_view &MangledName, in demangleType() argument
1836 std::tie(Quals, IsMember) = demangleQualifiers(MangledName); in demangleType()
1838 if (consumeFront(MangledName, '?')) in demangleType()
1839 std::tie(Quals, IsMember) = demangleQualifiers(MangledName); in demangleType()
1842 if (MangledName.empty()) { in demangleType()
1848 if (isTagType(MangledName)) in demangleType()
1849 Ty = demangleClassType(MangledName); in demangleType()
1850 else if (isPointerType(MangledName)) { in demangleType()
1851 if (isMemberPointer(MangledName, Error)) in demangleType()
1852 Ty = demangleMemberPointerType(MangledName); in demangleType()
1854 Ty = demanglePointerType(MangledName); in demangleType()
1857 } else if (isArrayType(MangledName)) in demangleType()
1858 Ty = demangleArrayType(MangledName); in demangleType()
1859 else if (isFunctionType(MangledName)) { in demangleType()
1860 if (consumeFront(MangledName, "$$A8@@")) in demangleType()
1861 Ty = demangleFunctionType(MangledName, true); in demangleType()
1863 assert(llvm::itanium_demangle::starts_with(MangledName, "$$A6")); in demangleType()
1864 consumeFront(MangledName, "$$A6"); in demangleType()
1865 Ty = demangleFunctionType(MangledName, false); in demangleType()
1867 } else if (isCustomType(MangledName)) { in demangleType()
1868 Ty = demangleCustomType(MangledName); in demangleType()
1870 Ty = demanglePrimitiveType(MangledName); in demangleType()
1879 bool Demangler::demangleThrowSpecification(std::string_view &MangledName) { in demangleThrowSpecification() argument
1880 if (consumeFront(MangledName, "_E")) in demangleThrowSpecification()
1882 if (consumeFront(MangledName, 'Z')) in demangleThrowSpecification()
1890 Demangler::demangleFunctionType(std::string_view &MangledName, in demangleFunctionType() argument
1895 FTy->Quals = demanglePointerExtQualifiers(MangledName); in demangleFunctionType()
1896 FTy->RefQualifier = demangleFunctionRefQualifier(MangledName); in demangleFunctionType()
1897 FTy->Quals = Qualifiers(FTy->Quals | demangleQualifiers(MangledName).first); in demangleFunctionType()
1901 FTy->CallConvention = demangleCallingConvention(MangledName); in demangleFunctionType()
1905 bool IsStructor = consumeFront(MangledName, '@'); in demangleFunctionType()
1907 FTy->ReturnType = demangleType(MangledName, QualifierMangleMode::Result); in demangleFunctionType()
1909 FTy->Params = demangleFunctionParameterList(MangledName, FTy->IsVariadic); in demangleFunctionType()
1911 FTy->IsNoexcept = demangleThrowSpecification(MangledName); in demangleFunctionType()
1917 Demangler::demangleFunctionEncoding(std::string_view &MangledName) { in demangleFunctionEncoding() argument
1919 if (consumeFront(MangledName, "$$J0")) in demangleFunctionEncoding()
1922 if (MangledName.empty()) { in demangleFunctionEncoding()
1927 FuncClass FC = demangleFunctionClass(MangledName); in demangleFunctionEncoding()
1934 TTN->ThisAdjust.StaticOffset = demangleSigned(MangledName); in demangleFunctionEncoding()
1938 TTN->ThisAdjust.VBPtrOffset = demangleSigned(MangledName); in demangleFunctionEncoding()
1939 TTN->ThisAdjust.VBOffsetOffset = demangleSigned(MangledName); in demangleFunctionEncoding()
1941 TTN->ThisAdjust.VtordispOffset = demangleSigned(MangledName); in demangleFunctionEncoding()
1942 TTN->ThisAdjust.StaticOffset = demangleSigned(MangledName); in demangleFunctionEncoding()
1952 FSN = demangleFunctionType(MangledName, HasThisQuals); in demangleFunctionEncoding()
1969 CustomTypeNode *Demangler::demangleCustomType(std::string_view &MangledName) { in demangleCustomType() argument
1970 assert(llvm::itanium_demangle::starts_with(MangledName, '?')); in demangleCustomType()
1971 MangledName.remove_prefix(1); in demangleCustomType()
1974 CTN->Identifier = demangleUnqualifiedTypeName(MangledName, /*Memorize=*/true); in demangleCustomType()
1975 if (!consumeFront(MangledName, '@')) in demangleCustomType()
1984 Demangler::demanglePrimitiveType(std::string_view &MangledName) { in demanglePrimitiveType() argument
1985 if (consumeFront(MangledName, "$$T")) in demanglePrimitiveType()
1988 const char F = MangledName.front(); in demanglePrimitiveType()
1989 MangledName.remove_prefix(1); in demanglePrimitiveType()
2018 if (MangledName.empty()) { in demanglePrimitiveType()
2022 const char F = MangledName.front(); in demanglePrimitiveType()
2023 MangledName.remove_prefix(1); in demanglePrimitiveType()
2047 TagTypeNode *Demangler::demangleClassType(std::string_view &MangledName) { in demangleClassType() argument
2050 const char F = MangledName.front(); in demangleClassType()
2051 MangledName.remove_prefix(1); in demangleClassType()
2063 if (!consumeFront(MangledName, '4')) { in demangleClassType()
2073 TT->QualifiedName = demangleFullyQualifiedTypeName(MangledName); in demangleClassType()
2079 PointerTypeNode *Demangler::demanglePointerType(std::string_view &MangledName) { in demanglePointerType() argument
2083 demanglePointerCVQualifiers(MangledName); in demanglePointerType()
2085 if (consumeFront(MangledName, "6")) { in demanglePointerType()
2086 Pointer->Pointee = demangleFunctionType(MangledName, false); in demanglePointerType()
2090 Qualifiers ExtQuals = demanglePointerExtQualifiers(MangledName); in demanglePointerType()
2093 Pointer->Pointee = demangleType(MangledName, QualifierMangleMode::Mangle); in demanglePointerType()
2098 Demangler::demangleMemberPointerType(std::string_view &MangledName) { in demangleMemberPointerType() argument
2102 demanglePointerCVQualifiers(MangledName); in demangleMemberPointerType()
2105 Qualifiers ExtQuals = demanglePointerExtQualifiers(MangledName); in demangleMemberPointerType()
2110 if (consumeFront(MangledName, "8")) { in demangleMemberPointerType()
2111 Pointer->ClassParent = demangleFullyQualifiedTypeName(MangledName); in demangleMemberPointerType()
2112 Pointer->Pointee = demangleFunctionType(MangledName, true); in demangleMemberPointerType()
2116 std::tie(PointeeQuals, IsMember) = demangleQualifiers(MangledName); in demangleMemberPointerType()
2118 Pointer->ClassParent = demangleFullyQualifiedTypeName(MangledName); in demangleMemberPointerType()
2120 Pointer->Pointee = demangleType(MangledName, QualifierMangleMode::Drop); in demangleMemberPointerType()
2129 Demangler::demanglePointerExtQualifiers(std::string_view &MangledName) { in demanglePointerExtQualifiers() argument
2131 if (consumeFront(MangledName, 'E')) in demanglePointerExtQualifiers()
2133 if (consumeFront(MangledName, 'I')) in demanglePointerExtQualifiers()
2135 if (consumeFront(MangledName, 'F')) in demanglePointerExtQualifiers()
2141 ArrayTypeNode *Demangler::demangleArrayType(std::string_view &MangledName) { in demangleArrayType() argument
2142 assert(MangledName.front() == 'Y'); in demangleArrayType()
2143 MangledName.remove_prefix(1); in demangleArrayType()
2147 std::tie(Rank, IsNegative) = demangleNumber(MangledName); in demangleArrayType()
2159 std::tie(D, IsNegative) = demangleNumber(MangledName); in demangleArrayType()
2172 if (consumeFront(MangledName, "$$C")) { in demangleArrayType()
2174 std::tie(ATy->Quals, IsMember) = demangleQualifiers(MangledName); in demangleArrayType()
2181 ATy->ElementType = demangleType(MangledName, QualifierMangleMode::Drop); in demangleArrayType()
2187 Demangler::demangleFunctionParameterList(std::string_view &MangledName, in demangleFunctionParameterList() argument
2190 if (consumeFront(MangledName, 'X')) in demangleFunctionParameterList()
2196 while (!Error && !llvm::itanium_demangle::starts_with(MangledName, '@') && in demangleFunctionParameterList()
2197 !llvm::itanium_demangle::starts_with(MangledName, 'Z')) { in demangleFunctionParameterList()
2200 if (startsWithDigit(MangledName)) { in demangleFunctionParameterList()
2201 size_t N = MangledName[0] - '0'; in demangleFunctionParameterList()
2206 MangledName.remove_prefix(1); in demangleFunctionParameterList()
2214 size_t OldSize = MangledName.size(); in demangleFunctionParameterList()
2217 TypeNode *TN = demangleType(MangledName, QualifierMangleMode::Drop); in demangleFunctionParameterList()
2223 size_t CharsConsumed = OldSize - MangledName.size(); in demangleFunctionParameterList()
2241 if (consumeFront(MangledName, '@')) in demangleFunctionParameterList()
2244 if (consumeFront(MangledName, 'Z')) { in demangleFunctionParameterList()
2253 Demangler::demangleTemplateParameterList(std::string_view &MangledName) { in demangleTemplateParameterList() argument
2258 while (!llvm::itanium_demangle::starts_with(MangledName, '@')) { in demangleTemplateParameterList()
2259 if (consumeFront(MangledName, "$S") || consumeFront(MangledName, "$$V") || in demangleTemplateParameterList()
2260 consumeFront(MangledName, "$$$V") || consumeFront(MangledName, "$$Z")) { in demangleTemplateParameterList()
2273 const bool IsAutoNTTP = consumeFront(MangledName, "$M"); in demangleTemplateParameterList()
2279 (void)demangleType(MangledName, QualifierMangleMode::Drop); in demangleTemplateParameterList()
2285 if (consumeFront(MangledName, "$$Y")) { in demangleTemplateParameterList()
2287 TP.N = demangleFullyQualifiedTypeName(MangledName); in demangleTemplateParameterList()
2288 } else if (consumeFront(MangledName, "$$B")) { in demangleTemplateParameterList()
2290 TP.N = demangleType(MangledName, QualifierMangleMode::Drop); in demangleTemplateParameterList()
2291 } else if (consumeFront(MangledName, "$$C")) { in demangleTemplateParameterList()
2293 TP.N = demangleType(MangledName, QualifierMangleMode::Mangle); in demangleTemplateParameterList()
2294 } else if (startsWith(MangledName, "$1", "1", !IsAutoNTTP) || in demangleTemplateParameterList()
2295 startsWith(MangledName, "$H", "H", !IsAutoNTTP) || in demangleTemplateParameterList()
2296 startsWith(MangledName, "$I", "I", !IsAutoNTTP) || in demangleTemplateParameterList()
2297 startsWith(MangledName, "$J", "J", !IsAutoNTTP)) { in demangleTemplateParameterList()
2303 MangledName.remove_prefix(1); // Remove leading '$' in demangleTemplateParameterList()
2309 char InheritanceSpecifier = MangledName.front(); in demangleTemplateParameterList()
2310 MangledName.remove_prefix(1); in demangleTemplateParameterList()
2312 if (llvm::itanium_demangle::starts_with(MangledName, '?')) { in demangleTemplateParameterList()
2313 S = parse(MangledName); in demangleTemplateParameterList()
2324 demangleSigned(MangledName); in demangleTemplateParameterList()
2328 demangleSigned(MangledName); in demangleTemplateParameterList()
2332 demangleSigned(MangledName); in demangleTemplateParameterList()
2341 } else if (llvm::itanium_demangle::starts_with(MangledName, "$E?")) { in demangleTemplateParameterList()
2342 consumeFront(MangledName, "$E"); in demangleTemplateParameterList()
2345 TPRN->Symbol = parse(MangledName); in demangleTemplateParameterList()
2347 } else if (startsWith(MangledName, "$F", "F", !IsAutoNTTP) || in demangleTemplateParameterList()
2348 startsWith(MangledName, "$G", "G", !IsAutoNTTP)) { in demangleTemplateParameterList()
2353 MangledName.remove_prefix(1); // Remove leading '$' in demangleTemplateParameterList()
2354 char InheritanceSpecifier = MangledName.front(); in demangleTemplateParameterList()
2355 MangledName.remove_prefix(1); in demangleTemplateParameterList()
2360 demangleSigned(MangledName); in demangleTemplateParameterList()
2364 demangleSigned(MangledName); in demangleTemplateParameterList()
2366 demangleSigned(MangledName); in demangleTemplateParameterList()
2373 } else if (consumeFront(MangledName, "$0", "0", !IsAutoNTTP)) { in demangleTemplateParameterList()
2377 std::tie(Value, IsNegative) = demangleNumber(MangledName); in demangleTemplateParameterList()
2381 TP.N = demangleType(MangledName, QualifierMangleMode::Drop); in demangleTemplateParameterList()
2395 MangledName, '@')); // The above loop exits only on '@'. in demangleTemplateParameterList()
2396 consumeFront(MangledName, '@'); in demangleTemplateParameterList()
2429 llvm::getArm64ECInsertionPointInMangledName(std::string_view MangledName) { in getArm64ECInsertionPointInMangledName() argument
2430 std::string_view ProcessedName{MangledName}; in getArm64ECInsertionPointInMangledName()
2443 return MangledName.length() - ProcessedName.length(); in getArm64ECInsertionPointInMangledName()
2446 char *llvm::microsoftDemangle(std::string_view MangledName, size_t *NMangled, in microsoftDemangle() argument
2450 std::string_view Name{MangledName}; in microsoftDemangle()
2453 *NMangled = MangledName.size() - Name.size(); in microsoftDemangle()