pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index 3392c04..fa3c681 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -130,6 +130,9 @@
unsigned VisitCXXThisExpr(CXXThisExpr *E);
unsigned VisitCXXThrowExpr(CXXThrowExpr *E);
unsigned VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E);
+ unsigned VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E);
+
+ unsigned VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E);
};
}
@@ -1028,7 +1031,27 @@
bool HasStoredExpr = Record[Idx++];
if (!HasStoredExpr) return 0;
E->setExpr(cast<Expr>(StmtStack.back()));
- return 1; // Read it.
+ return 1;
+}
+
+unsigned PCHStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
+ VisitExpr(E);
+ E->setTemporary(Reader.ReadCXXTemporary(Record, Idx));
+ E->setSubExpr(cast<Expr>(StmtStack.back()));
+ return 1;
+}
+
+
+unsigned PCHStmtReader::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
+ VisitExpr(E);
+ unsigned NumTemps = Record[Idx++];
+ if (NumTemps) {
+ E->setNumTemporaries(NumTemps);
+ for (unsigned i = 0; i != NumTemps; ++i)
+ E->setTemporary(i, Reader.ReadCXXTemporary(Record, Idx));
+ }
+ E->setSubExpr(cast<Expr>(StmtStack.back()));
+ return 1;
}
@@ -1396,6 +1419,13 @@
case pch::EXPR_CXX_DEFAULT_ARG:
S = new (Context) CXXDefaultArgExpr(Empty);
break;
+ case pch::EXPR_CXX_BIND_TEMPORARY:
+ S = new (Context) CXXBindTemporaryExpr(Empty);
+ break;
+
+ case pch::EXPR_CXX_EXPR_WITH_TEMPORARIES:
+ S = new (Context) CXXExprWithTemporaries(Empty);
+ break;
}
// We hit a STMT_STOP, so we're done with this expression.