StringRegion::print: Remove copy/paste code and just call Stmt::printPretty() for the StringLiteral.

llvm-svn: 62340
This commit is contained in:
Ted Kremenek 2009-01-16 19:26:50 +00:00
parent 5eef507b32
commit 0755a34604
1 changed files with 1 additions and 17 deletions

View File

@ -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);
}
//===----------------------------------------------------------------------===//