From 4259ebcdac724e2c9ec8933d8cbb94013997b785 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 2 Jul 2010 23:30:15 +0000 Subject: Fix broken PCH support for CXXDefaultArgExpr. llvm-svn: 107541 --- clang/lib/Frontend/PCHWriterStmt.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'clang/lib/Frontend/PCHWriterStmt.cpp') diff --git a/clang/lib/Frontend/PCHWriterStmt.cpp b/clang/lib/Frontend/PCHWriterStmt.cpp index 11b1afd3730..12fcde845ec 100644 --- a/clang/lib/Frontend/PCHWriterStmt.cpp +++ b/clang/lib/Frontend/PCHWriterStmt.cpp @@ -983,13 +983,14 @@ void PCHStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) { void PCHStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { VisitExpr(E); - Writer.AddSourceLocation(E->getUsedLocation(), Record); - if (E->isExprStored()) { - Record.push_back(1); + + bool HasOtherExprStored = E->Param.getInt(); + // Store these first, the reader reads them before creation. + Record.push_back(HasOtherExprStored); + if (HasOtherExprStored) Writer.AddStmt(E->getExpr()); - } else { - Record.push_back(0); - } + Writer.AddDeclRef(E->getParam(), Record); + Writer.AddSourceLocation(E->getUsedLocation(), Record); Code = pch::EXPR_CXX_DEFAULT_ARG; } -- cgit v1.2.3