mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 10:39:35 +08:00
Implemented serialization for ObjcAtCatchStmt.
llvm-svn: 44563
This commit is contained in:
@@ -155,6 +155,9 @@ Stmt* Stmt::Create(Deserializer& D) {
|
||||
//==--------------------------------------==//
|
||||
// Objective C
|
||||
//==--------------------------------------==//
|
||||
|
||||
case ObjcAtCatchStmtClass:
|
||||
return ObjcAtCatchStmt::CreateImpl(D);
|
||||
|
||||
case ObjCIvarRefExprClass:
|
||||
return ObjCIvarRefExpr::CreateImpl(D);
|
||||
@@ -825,6 +828,25 @@ WhileStmt* WhileStmt::CreateImpl(Deserializer& D) {
|
||||
// Objective C Serialization
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void ObjcAtCatchStmt::EmitImpl(Serializer& S) const {
|
||||
S.Emit(AtCatchLoc);
|
||||
S.Emit(RParenLoc);
|
||||
S.EmitPtr(NextAtCatchStmt);
|
||||
S.BatchEmitOwnedPtrs((unsigned) END_EXPR,&SubExprs[0]);
|
||||
}
|
||||
|
||||
ObjcAtCatchStmt* ObjcAtCatchStmt::CreateImpl(Deserializer& D) {
|
||||
SourceLocation AtCatchLoc = SourceLocation::ReadVal(D);
|
||||
SourceLocation RParenLoc = SourceLocation::ReadVal(D);
|
||||
|
||||
ObjcAtCatchStmt* stmt = new ObjcAtCatchStmt(AtCatchLoc,RParenLoc);
|
||||
|
||||
D.ReadPtr(stmt->NextAtCatchStmt); // Allows backpatching.
|
||||
D.BatchReadOwnedPtrs((unsigned) END_EXPR, &stmt->SubExprs[0]);
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
void ObjCIvarRefExpr::EmitImpl(Serializer& S) const {
|
||||
S.Emit(Loc);
|
||||
S.Emit(getType());
|
||||
|
||||
@@ -782,7 +782,11 @@ private:
|
||||
enum { SELECTOR, BODY, END_EXPR };
|
||||
Stmt *SubExprs[END_EXPR];
|
||||
SourceLocation AtCatchLoc, RParenLoc;
|
||||
|
||||
|
||||
// Used by deserialization.
|
||||
ObjcAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc)
|
||||
: Stmt(ObjcAtCatchStmtClass), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) {}
|
||||
|
||||
public:
|
||||
ObjcAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
|
||||
Stmt *catchVarStmtDecl, Stmt *atCatchStmt, Stmt *atCatchList)
|
||||
@@ -822,7 +826,9 @@ public:
|
||||
|
||||
virtual child_iterator child_begin();
|
||||
virtual child_iterator child_end();
|
||||
|
||||
|
||||
virtual void EmitImpl(llvm::Serializer& S) const;
|
||||
static ObjcAtCatchStmt* CreateImpl(llvm::Deserializer& D);
|
||||
};
|
||||
|
||||
/// ObjcAtFinallyStmt - This represent objective-c's @finally Statement
|
||||
|
||||
Reference in New Issue
Block a user