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
This commit is contained in:
David Majnemer 2014-03-30 06:34:26 +00:00
parent 6190ee65e1
commit 0dc714a00f
1 changed files with 2 additions and 3 deletions

View 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) {