[cfe-commits] r43846 - /cfe/trunk/AST/StmtSerialization.cpp
Ted Kremenek
kremenek at apple.com
Wed Nov 7 14:32:24 PST 2007
Author: kremenek
Date: Wed Nov 7 16:32:23 2007
New Revision: 43846
URL: http://llvm.org/viewvc/llvm-project?rev=43846&view=rev
Log:
Modified serialization of BinaryOperator and CaseStmt to use the new
BatchEmitOwnedPtrs() and BatchReadOwnedPtrs() methods.
Modified serialization of all Stmts to start their own record in the bitstream.
Modified:
cfe/trunk/AST/StmtSerialization.cpp
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=43846&r1=43845&r2=43846&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 16:32:23 2007
@@ -19,6 +19,7 @@
using namespace clang;
void Stmt::Emit(llvm::Serializer& S) const {
+ S.FlushRecord();
S.EmitInt(getStmtClass());
directEmit(S);
}
@@ -112,16 +113,16 @@
S.EmitInt(Opc);
S.Emit(OpLoc);;
S.Emit(getType());
- S.EmitOwnedPtr(getLHS());
- S.EmitOwnedPtr(getRHS());
+ S.BatchEmitOwnedPtrs(getLHS(),getRHS());
}
BinaryOperator* BinaryOperator::directMaterialize(llvm::Deserializer& D) {
Opcode Opc = static_cast<Opcode>(D.ReadInt());
SourceLocation OpLoc = SourceLocation::ReadVal(D);
QualType Result = QualType::ReadVal(D);
- Expr* LHS = D.ReadOwnedPtr<Expr>();
- Expr* RHS = D.ReadOwnedPtr<Expr>();
+ Expr *LHS, *RHS;
+ D.BatchReadOwnedPtrs(LHS,RHS);
+
return new BinaryOperator(LHS,RHS,Opc,Result,OpLoc);
}
@@ -136,21 +137,18 @@
void CaseStmt::directEmit(llvm::Serializer& S) const {
S.Emit(CaseLoc);
- S.EmitOwnedPtr(getLHS());
- S.EmitOwnedPtr(getRHS());
- S.EmitOwnedPtr(getSubStmt());
S.EmitPtr(getNextSwitchCase());
+ S.BatchEmitOwnedPtrs(getLHS(),getRHS(),getSubStmt());
}
CaseStmt* CaseStmt::directMaterialize(llvm::Deserializer& D) {
SourceLocation CaseLoc = SourceLocation::ReadVal(D);
- Expr* LHS = D.ReadOwnedPtr<Expr>();
- Expr* RHS = D.ReadOwnedPtr<Expr>();
- Stmt* SubStmt = D.ReadOwnedPtr<Stmt>();
+ Expr *LHS, *RHS;
+ Stmt* SubStmt;
+ D.BatchReadOwnedPtrs(LHS,RHS,SubStmt);
CaseStmt* stmt = new CaseStmt(LHS,RHS,SubStmt,CaseLoc);
- stmt->setNextSwitchCase(D.ReadPtr<SwitchCase>());
-
+ stmt->setNextSwitchCase(D.ReadPtr<SwitchCase>());
return stmt;
}
More information about the cfe-commits
mailing list