aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriterStmt.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-10-25 08:47:36 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-10-25 08:47:36 +0000
commit428edafa9eb80e01dd40aab31d4166a787a741e1 (patch)
tree618b88a0399873548adeeeb442cb87be3426862d /lib/Serialization/ASTWriterStmt.cpp
parent8c5e5d6d8a316af5a9842169f541cac49717887d (diff)
Improve the tracking of source locations for parentheses in constructor calls.
This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r--lib/Serialization/ASTWriterStmt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp
index 657cd68343..33b70e98c0 100644
--- a/lib/Serialization/ASTWriterStmt.cpp
+++ b/lib/Serialization/ASTWriterStmt.cpp
@@ -978,13 +978,13 @@ void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
Record.push_back(E->isElidable());
Record.push_back(E->requiresZeroInitialization());
Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
+ Writer.AddSourceRange(E->getParenRange(), Record);
Code = serialization::EXPR_CXX_CONSTRUCT;
}
void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
VisitCXXConstructExpr(E);
Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
- Writer.AddSourceLocation(E->getRParenLoc(), Record);
Code = serialization::EXPR_CXX_TEMPORARY_OBJECT;
}
@@ -1113,6 +1113,8 @@ void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
Writer.AddSourceRange(E->getTypeIdParens(), Record);
Writer.AddSourceLocation(E->getStartLoc(), Record);
Writer.AddSourceLocation(E->getEndLoc(), Record);
+ Writer.AddSourceLocation(E->getConstructorLParen(), Record);
+ Writer.AddSourceLocation(E->getConstructorRParen(), Record);
for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), e = E->raw_arg_end();
I != e; ++I)
Writer.AddStmt(*I);