diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-10-25 08:47:36 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-10-25 08:47:36 +0000 |
commit | 428edafa9eb80e01dd40aab31d4166a787a741e1 (patch) | |
tree | 618b88a0399873548adeeeb442cb87be3426862d /lib/Serialization/ASTReaderStmt.cpp | |
parent | 8c5e5d6d8a316af5a9842169f541cac49717887d (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/ASTReaderStmt.cpp')
-rw-r--r-- | lib/Serialization/ASTReaderStmt.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index f1137c0e33..4011fa8c1c 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/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); |