aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/StmtSerialization.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2008-12-02 14:43:59 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2008-12-02 14:43:59 +0000
commitcee63fbf0e64ac526582312bf8cf33263fc5c16e (patch)
tree274408c3fad7aaaaa463f5f50bce9f516ff3422b /lib/AST/StmtSerialization.cpp
parent04f9d468f7abfd8a1d85a2ef7cd9c48adb1efa58 (diff)
Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtSerialization.cpp')
-rw-r--r--lib/AST/StmtSerialization.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/AST/StmtSerialization.cpp b/lib/AST/StmtSerialization.cpp
index 40f5b3ffc5..a8602245f3 100644
--- a/lib/AST/StmtSerialization.cpp
+++ b/lib/AST/StmtSerialization.cpp
@@ -1444,7 +1444,10 @@ CXXZeroInitValueExpr::CreateImpl(Deserializer& D, ASTContext& C) {
void CXXNewExpr::EmitImpl(Serializer& S) const {
S.Emit(getType());
- S.Emit(Initializer);
+ S.EmitBool(GlobalNew);
+ S.EmitBool(ParenTypeId);
+ S.EmitBool(Initializer);
+ S.EmitBool(Array);
S.EmitInt(NumPlacementArgs);
S.EmitInt(NumConstructorArgs);
S.BatchEmitOwnedPtrs(NumPlacementArgs + NumConstructorArgs, SubExprs);
@@ -1455,7 +1458,6 @@ void CXXNewExpr::EmitImpl(Serializer& S) const {
S.EmitPtr(OperatorNew);
S.EmitPtr(OperatorDelete);
S.EmitPtr(Constructor);
- S.Emit(AllocType);
S.Emit(StartLoc);
S.Emit(EndLoc);
}
@@ -1466,19 +1468,19 @@ CXXNewExpr::CreateImpl(Deserializer& D, ASTContext& C) {
bool GlobalNew = D.ReadBool();
bool ParenTypeId = D.ReadBool();
bool Initializer = D.ReadBool();
+ bool Array = D.ReadBool();
unsigned NumPlacementArgs = D.ReadInt();
unsigned NumConstructorArgs = D.ReadInt();
- unsigned TotalExprs = NumPlacementArgs + NumConstructorArgs;
+ unsigned TotalExprs = Array + NumPlacementArgs + NumConstructorArgs;
Stmt** SubExprs = new Stmt*[TotalExprs];
D.BatchReadOwnedPtrs(TotalExprs, SubExprs, C);
FunctionDecl *OperatorNew = D.ReadPtr<FunctionDecl>();
FunctionDecl *OperatorDelete = D.ReadPtr<FunctionDecl>();
CXXConstructorDecl *Constructor = D.ReadPtr<CXXConstructorDecl>();
- QualType AllocType = QualType::ReadVal(D);
SourceLocation StartLoc = SourceLocation::ReadVal(D);
SourceLocation EndLoc = SourceLocation::ReadVal(D);
- return new CXXNewExpr(T, AllocType, GlobalNew, ParenTypeId, Initializer,
+ return new CXXNewExpr(T, GlobalNew, ParenTypeId, Initializer, Array,
NumPlacementArgs, NumConstructorArgs, SubExprs,
OperatorNew, OperatorDelete, Constructor, StartLoc,
EndLoc);
@@ -1486,8 +1488,8 @@ CXXNewExpr::CreateImpl(Deserializer& D, ASTContext& C) {
void CXXDeleteExpr::EmitImpl(Serializer& S) const {
S.Emit(getType());
- S.Emit(GlobalDelete);
- S.Emit(ArrayForm);
+ S.EmitBool(GlobalDelete);
+ S.EmitBool(ArrayForm);
S.EmitPtr(OperatorDelete);
S.EmitOwnedPtr(Argument);
S.Emit(Loc);