r205128 - MS ABI: Simplify MangleByte

David Majnemer david.majnemer at gmail.com
Sat Mar 29 23:34:26 PDT 2014


Author: majnemer
Date: Sun Mar 30 01:34:26 2014
New Revision: 205128

URL: http://llvm.org/viewvc/llvm-project?rev=205128&view=rev
Log:
MS ABI: Simplify MangleByte

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.

Modified:
    cfe/trunk/lib/AST/MicrosoftMangle.cpp

Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=205128&r1=205127&r2=205128&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Sun Mar 30 01:34:26 2014
@@ -2421,9 +2421,8 @@ void MicrosoftMangleContextImpl::mangleS
     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) {





More information about the cfe-commits mailing list