forked from OSchip/llvm-project
parent
ba1a98a4e0
commit
273a1ea2e8
|
@ -166,17 +166,14 @@ void StmtDumper::VisitCompoundStmt(CompoundStmt *Node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtDumper::VisitCaseStmt(CaseStmt *Node) {
|
void StmtDumper::VisitCaseStmt(CaseStmt *Node) {
|
||||||
#if 0
|
DumpStmt(Node);
|
||||||
Indent(-1) << "case ";
|
fprintf(F, "\n");
|
||||||
DumpExpr(Node->getLHS());
|
DumpSubTree(Node->getLHS());
|
||||||
if (Node->getRHS()) {
|
fprintf(F, "\n");
|
||||||
OS << " ... ";
|
DumpSubTree(Node->getRHS());
|
||||||
DumpExpr(Node->getRHS());
|
fprintf(F, "\n");
|
||||||
}
|
DumpSubTree(Node->getSubStmt());
|
||||||
OS << ":\n";
|
fprintf(F, ")");
|
||||||
|
|
||||||
DumpSubTree(Node->getSubStmt(), 0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtDumper::VisitDefaultStmt(DefaultStmt *Node) {
|
void StmtDumper::VisitDefaultStmt(DefaultStmt *Node) {
|
||||||
|
@ -313,53 +310,8 @@ void StmtDumper::VisitPreDefinedExpr(PreDefinedExpr *Node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtDumper::VisitCharacterLiteral(CharacterLiteral *Node) {
|
void StmtDumper::VisitCharacterLiteral(CharacterLiteral *Node) {
|
||||||
#if 0
|
DumpExpr(Node);
|
||||||
// FIXME should print an L for wchar_t constants
|
fprintf(F, " %d)", Node->getValue());
|
||||||
unsigned value = Node->getValue();
|
|
||||||
switch (value) {
|
|
||||||
case '\\':
|
|
||||||
OS << "'\\\\'";
|
|
||||||
break;
|
|
||||||
case '\'':
|
|
||||||
OS << "'\\''";
|
|
||||||
break;
|
|
||||||
case '\a':
|
|
||||||
// TODO: K&R: the meaning of '\\a' is different in traditional C
|
|
||||||
OS << "'\\a'";
|
|
||||||
break;
|
|
||||||
case '\b':
|
|
||||||
OS << "'\\b'";
|
|
||||||
break;
|
|
||||||
// Nonstandard escape sequence.
|
|
||||||
/*case '\e':
|
|
||||||
OS << "'\\e'";
|
|
||||||
break;*/
|
|
||||||
case '\f':
|
|
||||||
OS << "'\\f'";
|
|
||||||
break;
|
|
||||||
case '\n':
|
|
||||||
OS << "'\\n'";
|
|
||||||
break;
|
|
||||||
case '\r':
|
|
||||||
OS << "'\\r'";
|
|
||||||
break;
|
|
||||||
case '\t':
|
|
||||||
OS << "'\\t'";
|
|
||||||
break;
|
|
||||||
case '\v':
|
|
||||||
OS << "'\\v'";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (isprint(value) && value < 256) {
|
|
||||||
OS << "'" << (char)value << "'";
|
|
||||||
} else if (value < 256) {
|
|
||||||
OS << "'\\x" << std::hex << value << std::dec << "'";
|
|
||||||
} else {
|
|
||||||
// FIXME what to really do here?
|
|
||||||
OS << value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtDumper::VisitIntegerLiteral(IntegerLiteral *Node) {
|
void StmtDumper::VisitIntegerLiteral(IntegerLiteral *Node) {
|
||||||
|
@ -373,11 +325,15 @@ void StmtDumper::VisitFloatingLiteral(FloatingLiteral *Node) {
|
||||||
fprintf(F, " %f)", Node->getValue());
|
fprintf(F, " %f)", Node->getValue());
|
||||||
}
|
}
|
||||||
void StmtDumper::VisitStringLiteral(StringLiteral *Str) {
|
void StmtDumper::VisitStringLiteral(StringLiteral *Str) {
|
||||||
|
DumpExpr(Str);
|
||||||
|
// FIXME: this doesn't print wstrings right.
|
||||||
|
// FIXME: this doesn't print strings with \0's in them.
|
||||||
|
fprintf(F, " \"%s\")", Str->getStrData());
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (Str->isWide()) OS << 'L';
|
if (Str->isWide()) OS << 'L';
|
||||||
OS << '"';
|
OS << '"';
|
||||||
|
|
||||||
// FIXME: this doesn't print wstrings right.
|
|
||||||
for (unsigned i = 0, e = Str->getByteLength(); i != e; ++i) {
|
for (unsigned i = 0, e = Str->getByteLength(); i != e; ++i) {
|
||||||
switch (Str->getStrData()[i]) {
|
switch (Str->getStrData()[i]) {
|
||||||
default: OS << Str->getStrData()[i]; break;
|
default: OS << Str->getStrData()[i]; break;
|
||||||
|
|
Loading…
Reference in New Issue