diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-04-01 00:05:57 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-04-01 00:05:57 +0000 |
commit | 10befcf993828864c29999455c7d0b4c94b483b2 (patch) | |
tree | 8184eddc352b4ccefcc23298b2f4d5748b0c2915 | |
parent | f78cbb5b44826dbdfd07dbc0d21ae63ac6daccc5 (diff) | |
download | bcm5719-llvm-10befcf993828864c29999455c7d0b4c94b483b2.tar.gz bcm5719-llvm-10befcf993828864c29999455c7d0b4c94b483b2.zip |
MS ABI: Simplify MangleByte further
It turns out that the ranges where the '?' <letter> manglings occur are
identical to the ranges of ASCII characters OR'd with 0x80.
Thanks to Richard Smith for the insight!
No functional change.
llvm-svn: 205270
-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 ',': |