When serializing CompoundLiteralExpr, serialize out the file scope flag before
serializing the subexpression (Init), as this results in a more efficient
encoding in the bitstream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45967 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index f0a1a38..545813c 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -391,15 +391,15 @@
void CompoundLiteralExpr::EmitImpl(Serializer& S) const {
S.Emit(getType());
S.Emit(getLParenLoc());
- S.EmitOwnedPtr(Init);
S.EmitBool(isFileScope());
+ S.EmitOwnedPtr(Init);
}
CompoundLiteralExpr* CompoundLiteralExpr::CreateImpl(Deserializer& D) {
QualType Q = QualType::ReadVal(D);
SourceLocation L = SourceLocation::ReadVal(D);
- Expr* Init = D.ReadOwnedPtr<Expr>();
bool fileScope = D.ReadBool();
+ Expr* Init = D.ReadOwnedPtr<Expr>();
return new CompoundLiteralExpr(L, Q, Init, fileScope);
}