StringRegion::print: Remove copy/paste code and just call Stmt::printPretty() for the StringLiteral.
llvm-svn: 62340
This commit is contained in:
parent
5eef507b32
commit
0755a34604
|
@ -179,23 +179,7 @@ void CompoundLiteralRegion::print(llvm::raw_ostream& os) const {
|
|||
}
|
||||
|
||||
void StringRegion::print(llvm::raw_ostream& os) const {
|
||||
if (Str->isWide()) os << 'L';
|
||||
os << '"';
|
||||
|
||||
// FIXME: this doesn't print wstrings right.
|
||||
for (unsigned i = 0, e = Str->getByteLength(); i != e; ++i) {
|
||||
switch (Str->getStrData()[i]) {
|
||||
default: os << Str->getStrData()[i]; break;
|
||||
// Handle some common ones to make dumps prettier.
|
||||
case '\\': os << "\\\\"; break;
|
||||
case '"': os << "\\\""; break;
|
||||
case '\n': os << "\\n"; break;
|
||||
case '\t': os << "\\t"; break;
|
||||
case '\a': os << "\\a"; break;
|
||||
case '\b': os << "\\b"; break;
|
||||
}
|
||||
}
|
||||
os << '"';
|
||||
Str->printPretty(os);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
Loading…
Reference in New Issue