summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderStmt.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
commit0171815ae193d08f56feade3273d9ae59ac3198a (patch)
tree8f4ed1f3ca055873595191fa56b179b820be3246 /clang/lib/Serialization/ASTReaderStmt.cpp
parent01769904d3ddeb9ffb238a8387663b286624214c (diff)
downloadbcm5719-llvm-0171815ae193d08f56feade3273d9ae59ac3198a.tar.gz
bcm5719-llvm-0171815ae193d08f56feade3273d9ae59ac3198a.zip
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. llvm-svn: 117254
Diffstat (limited to 'clang/lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderStmt.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index f1137c0e338..4011fa8c1cd 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -1001,12 +1001,12 @@ void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
E->setElidable(Record[Idx++]);
E->setRequiresZeroInitialization(Record[Idx++]);
E->setConstructionKind((CXXConstructExpr::ConstructionKind)Record[Idx++]);
+ E->ParenRange = ReadSourceRange(Record, Idx);
}
void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
VisitCXXConstructExpr(E);
E->Type = GetTypeSourceInfo(Record, Idx);
- E->RParenLoc = ReadSourceLocation(Record, Idx);
}
void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
@@ -1122,9 +1122,11 @@ void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
TypeIdParens.setBegin(ReadSourceLocation(Record, Idx));
TypeIdParens.setEnd(ReadSourceLocation(Record, Idx));
E->TypeIdParens = TypeIdParens;
- E->setStartLoc(ReadSourceLocation(Record, Idx));
- E->setEndLoc(ReadSourceLocation(Record, Idx));
-
+ E->StartLoc = ReadSourceLocation(Record, Idx);
+ E->EndLoc = ReadSourceLocation(Record, Idx);
+ E->ConstructorLParen = ReadSourceLocation(Record, Idx);
+ E->ConstructorRParen = ReadSourceLocation(Record, Idx);
+
E->AllocateArgsArray(*Reader.getContext(), isArray, NumPlacementArgs,
NumCtorArgs);
OpenPOWER on IntegriCloud