mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-08 21:47:23 +00:00
change printStringChar to emit characters as unsigned char instead of char,
avoiding sign extension for the top octet. For "negative" chars, we'd print stuff like: .asciz "\702... now we print: .asciz "\302... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68577 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
97121ba2af
commit
a118c2ee89
@ -699,7 +699,7 @@ static inline char toOctal(int X) {
|
||||
|
||||
/// printStringChar - Print a char, escaped if necessary.
|
||||
///
|
||||
static void printStringChar(raw_ostream &O, char C) {
|
||||
static void printStringChar(raw_ostream &O, unsigned char C) {
|
||||
if (C == '"') {
|
||||
O << "\\\"";
|
||||
} else if (C == '\\') {
|
||||
@ -733,10 +733,8 @@ void AsmPrinter::EmitString(const std::string &String) const {
|
||||
else
|
||||
O << TAI->getAsciiDirective();
|
||||
O << '\"';
|
||||
for (unsigned i = 0, N = String.size(); i < N; ++i) {
|
||||
unsigned char C = String[i];
|
||||
printStringChar(O, C);
|
||||
}
|
||||
for (unsigned i = 0, N = String.size(); i < N; ++i)
|
||||
printStringChar(O, String[i]);
|
||||
if (AscizDirective)
|
||||
O << '\"';
|
||||
else
|
||||
@ -747,10 +745,8 @@ void AsmPrinter::EmitString(const std::string &String) const {
|
||||
/// EmitFile - Emit a .file directive.
|
||||
void AsmPrinter::EmitFile(unsigned Number, const std::string &Name) const {
|
||||
O << "\t.file\t" << Number << " \"";
|
||||
for (unsigned i = 0, N = Name.size(); i < N; ++i) {
|
||||
unsigned char C = Name[i];
|
||||
printStringChar(O, C);
|
||||
}
|
||||
for (unsigned i = 0, N = Name.size(); i < N; ++i)
|
||||
printStringChar(O, Name[i]);
|
||||
O << '\"';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user