aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriterStmt.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-02 23:30:15 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-02 23:30:15 +0000
commit8a50733034edd6a349b34e2b9f0c8d0a874846d3 (patch)
treed37411705ae848aa94dfe4ab62071845e70d005a /lib/Frontend/PCHWriterStmt.cpp
parente5eee5a52d98021de862b7965c88577598d52ccb (diff)
Fix broken PCH support for CXXDefaultArgExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriterStmt.cpp')
-rw-r--r--lib/Frontend/PCHWriterStmt.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Frontend/PCHWriterStmt.cpp b/lib/Frontend/PCHWriterStmt.cpp
index 11b1afd373..12fcde845e 100644
--- a/lib/Frontend/PCHWriterStmt.cpp
+++ b/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;
}