mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Bug fix: don't unnecessarily pretty-print control-characters, some of
which were wrong (particularly, '\a' for '\007'). llvm-svn: 7393
This commit is contained in:
parent
98618cd85c
commit
0a6bd349c2
@ -594,21 +594,10 @@ static string getAsCString(const ConstantArray *CVA) {
|
||||
} else if (isprint(C)) {
|
||||
Result += C;
|
||||
} else {
|
||||
switch(C) {
|
||||
case '\a': Result += "\\a"; break;
|
||||
case '\b': Result += "\\b"; break;
|
||||
case '\f': Result += "\\f"; break;
|
||||
case '\n': Result += "\\n"; break;
|
||||
case '\r': Result += "\\r"; break;
|
||||
case '\t': Result += "\\t"; break;
|
||||
case '\v': Result += "\\v"; break;
|
||||
default:
|
||||
Result += '\\';
|
||||
Result += toOctal(C >> 6);
|
||||
Result += toOctal(C >> 3);
|
||||
Result += toOctal(C >> 0);
|
||||
break;
|
||||
}
|
||||
Result += '\\'; // print all other chars as octal value
|
||||
Result += toOctal(C >> 6);
|
||||
Result += toOctal(C >> 3);
|
||||
Result += toOctal(C >> 0);
|
||||
}
|
||||
}
|
||||
Result += "\"";
|
||||
|
Loading…
Reference in New Issue
Block a user