From 0dc714a00f222c2d1ccf5822ec6ba99a82fc56e8 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sun, 30 Mar 2014 06:34:26 +0000 Subject: [PATCH] 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. llvm-svn: 205128 --- clang/lib/AST/MicrosoftMangle.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 9dfd2af8bb61..5510f96596f5 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -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('a' + (Byte - '\xe1')); - } else if (Byte >= '\xc1' && Byte <= '\xda') { + } else if ((Byte >= '\xe1' && Byte <= '\xfa') || + (Byte >= '\xc1' && Byte <= '\xda')) { Mangler.getStream() << '?' << static_cast('A' + (Byte - '\xc1')); } else { switch (Byte) {