]> granicus.if.org Git - clang/commitdiff
MS ABI: Simplify MangleByte
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 30 Mar 2014 06:34:26 +0000 (06:34 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 30 Mar 2014 06:34:26 +0000 (06:34 +0000)
The delta between '\xe1' and '\xc1' is equivalent to the one between 'a'
and 'A'.  This allows us to reuse the computation between '\xe1' and
'\xfa' for the '\xc1' to '\xda' case.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205128 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/MicrosoftMangle.cpp

index 9dfd2af8bb610fccf8e8f890e836d52f783f467c..5510f96596f5cce91f721d51a97addc8d45dbf15 100644 (file)
@@ -2421,9 +2421,8 @@ void MicrosoftMangleContextImpl::mangleStringLiteral(const StringLiteral *SL,
     if ((Byte >= 'a' && Byte <= 'z') || (Byte >= 'A' && Byte <= 'Z') ||
         (Byte >= '0' && Byte <= '9') || Byte == '_' || Byte == '$') {
       Mangler.getStream() << Byte;
-    } else if (Byte >= '\xe1' && Byte <= '\xfa') {
-      Mangler.getStream() << '?' << static_cast<char>('a' + (Byte - '\xe1'));
-    } else if (Byte >= '\xc1' && Byte <= '\xda') {
+    } else if ((Byte >= '\xe1' && Byte <= '\xfa') ||
+               (Byte >= '\xc1' && Byte <= '\xda')) {
       Mangler.getStream() << '?' << static_cast<char>('A' + (Byte - '\xc1'));
     } else {
       switch (Byte) {