diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-13 06:29:04 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-13 06:29:04 +0000 |
| commit | 81c018d9482e7cc2addadc6202dcf162a01faefd (patch) | |
| tree | 3d524b76af50356a3c9b295ddbad2f175fdf7d52 /AST/StmtSerialization.cpp | |
| parent | 3de54ffeb037a7af037f3089e4cd4e917ce7b3ca (diff) | |
improve DeclStmt to be able to store SourceRange info correctly.
Set the start of DeclStmt range. Right now the end is meaningless
though.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/StmtSerialization.cpp')
| -rw-r--r-- | AST/StmtSerialization.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index 5f1ab62072..433e8e2702 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -456,6 +456,8 @@ ContinueStmt* ContinueStmt::CreateImpl(Deserializer& D) { void DeclStmt::EmitImpl(Serializer& S) const { // FIXME: special handling for struct decls. S.EmitOwnedPtr(getDecl()); + S.Emit(StartLoc); + S.Emit(EndLoc); } void DeclRefExpr::EmitImpl(Serializer& S) const { @@ -505,7 +507,9 @@ DeclRefExpr* DeclRefExpr::CreateImpl(Deserializer& D) { DeclStmt* DeclStmt::CreateImpl(Deserializer& D) { ScopedDecl* decl = cast<ScopedDecl>(D.ReadOwnedPtr<Decl>()); - return new DeclStmt(decl); + SourceLocation StartLoc = SourceLocation::ReadVal(D); + SourceLocation EndLoc = SourceLocation::ReadVal(D); + return new DeclStmt(decl, StartLoc, EndLoc); } void DefaultStmt::EmitImpl(Serializer& S) const { |
