diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-17 16:55:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-17 16:55:36 +0000 |
commit | 84f2170062014d268951902164bed0d8bdea0e82 (patch) | |
tree | e41c433001b4b1c98adc2e0d5a1c7f2e3afca12a /lib/Frontend/PCHWriter.cpp | |
parent | 0de9d8857b715c2f45c987651f4ce06d73330d93 (diff) |
PCH support for declaration statements, and a test for PredefinedExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 91490549ea..4b4e897166 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -459,6 +459,7 @@ namespace { void VisitContinueStmt(ContinueStmt *S); void VisitBreakStmt(BreakStmt *S); void VisitReturnStmt(ReturnStmt *S); + void VisitDeclStmt(DeclStmt *S); void VisitExpr(Expr *E); void VisitPredefinedExpr(PredefinedExpr *E); void VisitDeclRefExpr(DeclRefExpr *E); @@ -600,6 +601,16 @@ void PCHStmtWriter::VisitReturnStmt(ReturnStmt *S) { Code = pch::STMT_RETURN; } +void PCHStmtWriter::VisitDeclStmt(DeclStmt *S) { + VisitStmt(S); + Writer.AddSourceLocation(S->getStartLoc(), Record); + Writer.AddSourceLocation(S->getEndLoc(), Record); + DeclGroupRef DG = S->getDeclGroup(); + for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D) + Writer.AddDeclRef(*D, Record); + Code = pch::STMT_DECL; +} + void PCHStmtWriter::VisitExpr(Expr *E) { VisitStmt(E); Writer.AddTypeRef(E->getType(), Record); |