diff options
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 4f6ee315a7c..804b8a9408d 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -2428,13 +2428,10 @@ void MicrosoftMangleContextImpl::mangleStringLiteral(const StringLiteral *SL, // - ?[A-Z]: The range from \xc1 to \xda. // - ?[0-9]: The set of [,/\:. \n\t'-]. // - ?$XX: A fallback which maps nibbles. - if ((Byte >= 'a' && Byte <= 'z') || (Byte >= 'A' && Byte <= 'Z') || - (Byte >= '0' && Byte <= '9') || Byte == '_' || Byte == '$') { + if (isIdentifierBody(Byte, /*AllowDollar=*/true)) { Mangler.getStream() << Byte; - } else if ((Byte >= '\xe1' && Byte <= '\xfa') || - (Byte >= '\xc1' && Byte <= '\xda')) { - // The delta between '\xe1' and '\xc1' is the same as 'a' to 'A'. - Mangler.getStream() << '?' << static_cast<char>('A' + (Byte - '\xc1')); + } else if (isLetter(Byte & 0x7f)) { + Mangler.getStream() << '?' << static_cast<char>(Byte & 0x7f); } else { switch (Byte) { case ',': |