[cfe-commits] r44564 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Mon Dec 3 16:32:23 PST 2007
Author: kremenek
Date: Mon Dec 3 18:32:22 2007
New Revision: 44564
URL: http://llvm.org/viewvc/llvm-project?rev=44564&view=rev
Log:
Implemented serialization for ObjcAtFinallyStmt.
Modified:
cfe/trunk/AST/StmtSerialization.cpp
cfe/trunk/include/clang/AST/Stmt.h
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=44564&r1=44563&r2=44564&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Mon Dec 3 18:32:22 2007
@@ -159,6 +159,9 @@
case ObjcAtCatchStmtClass:
return ObjcAtCatchStmt::CreateImpl(D);
+ case ObjcAtFinallyStmtClass:
+ return ObjcAtFinallyStmt::CreateImpl(D);
+
case ObjCIvarRefExprClass:
return ObjCIvarRefExpr::CreateImpl(D);
}
@@ -847,6 +850,17 @@
return stmt;
}
+void ObjcAtFinallyStmt::EmitImpl(Serializer& S) const {
+ S.Emit(AtFinallyLoc);
+ S.EmitOwnedPtr(AtFinallyStmt);
+}
+
+ObjcAtFinallyStmt* ObjcAtFinallyStmt::CreateImpl(Deserializer& D) {
+ SourceLocation Loc = SourceLocation::ReadVal(D);
+ Stmt* AtFinallyStmt = D.ReadOwnedPtr<Stmt>();
+ return new ObjcAtFinallyStmt(Loc,AtFinallyStmt);
+}
+
void ObjCIvarRefExpr::EmitImpl(Serializer& S) const {
S.Emit(Loc);
S.Emit(getType());
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=44564&r1=44563&r2=44564&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Dec 3 18:32:22 2007
@@ -833,30 +833,30 @@
/// ObjcAtFinallyStmt - This represent objective-c's @finally Statement
class ObjcAtFinallyStmt : public Stmt {
- private:
- Stmt *AtFinallyStmt;
- SourceLocation AtFinallyLoc;
-
- public:
- ObjcAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
- : Stmt(ObjcAtFinallyStmtClass),
- AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
-
- const Stmt *getFinallyBody () const { return AtFinallyStmt; }
- Stmt *getFinallyBody () { return AtFinallyStmt; }
+ Stmt *AtFinallyStmt;
+ SourceLocation AtFinallyLoc;
+public:
+ ObjcAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
+ : Stmt(ObjcAtFinallyStmtClass),
+ AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
- virtual SourceRange getSourceRange() const {
- return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd());
- }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcAtFinallyStmtClass;
- }
- static bool classof(const ObjcAtFinallyStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-
+ const Stmt *getFinallyBody () const { return AtFinallyStmt; }
+ Stmt *getFinallyBody () { return AtFinallyStmt; }
+
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd());
+ }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjcAtFinallyStmtClass;
+ }
+ static bool classof(const ObjcAtFinallyStmt *) { return true; }
+
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+
+ virtual void EmitImpl(llvm::Serializer& S) const;
+ static ObjcAtFinallyStmt* CreateImpl(llvm::Deserializer& D);
};
/// ObjcAtTryStmt - This represent objective-c's over-all
More information about the cfe-commits
mailing list