Add some information about temporaries to the statement dumper.

llvm-svn: 78754
This commit is contained in:
Anders Carlsson 2009-08-12 00:21:52 +00:00
parent e93b54be8d
commit 0738468322
1 changed files with 31 additions and 0 deletions

View File

@ -137,6 +137,10 @@ namespace {
void VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *Node);
void VisitCXXThisExpr(CXXThisExpr *Node);
void VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *Node);
void VisitCXXConstructExpr(CXXConstructExpr *Node);
void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *Node);
void VisitCXXExprWithTemporaries(CXXExprWithTemporaries *Node);
void DumpCXXTemporary(CXXTemporary *Temporary);
// ObjC
void VisitObjCEncodeExpr(ObjCEncodeExpr *Node);
@ -451,6 +455,33 @@ void StmtDumper::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *Node) {
Node->getTypeAsWritten().getAsString().c_str());
}
void StmtDumper::VisitCXXConstructExpr(CXXConstructExpr *Node) {
DumpExpr(Node);
if (Node->isElidable())
fprintf(F, "elidable");
}
void StmtDumper::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *Node) {
DumpExpr(Node);
fprintf(F, " ");
DumpCXXTemporary(Node->getTemporary());
}
void StmtDumper::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *Node) {
DumpExpr(Node);
++IndentLevel;
for (unsigned i = 0, e = Node->getNumTemporaries(); i != e; ++i) {
fprintf(F, "\n");
Indent();
DumpCXXTemporary(Node->getTemporary(i));
}
--IndentLevel;
}
void StmtDumper::DumpCXXTemporary(CXXTemporary *Temporary) {
fprintf(F, "(CXXTemporary %p)", (void *)Temporary);
}
//===----------------------------------------------------------------------===//
// Obj-C Expressions
//===----------------------------------------------------------------------===//