[cfe-commits] r70105 - in /cfe/trunk: clang.xcodeproj/project.pbxproj include/clang/AST/Stmt.h include/clang/AST/StmtObjC.h include/clang/AST/StmtVisitor.h include/clang/Analysis/PathSensitive/GRExprEngine.h lib/AST/Stmt.cpp lib/Analysis/BugReporter.cpp lib/Analysis/GRExprEngine.cpp lib/CodeGen/CGObjC.cpp lib/CodeGen/CGObjCGNU.cpp lib/CodeGen/CGObjCMac.cpp lib/CodeGen/CodeGenFunction.h lib/Frontend/PCHWriter.cpp lib/Sema/JumpDiagnostics.cpp lib/Sema/SemaStmt.cpp
Chris Lattner
sabre at nondot.org
Sat Apr 25 18:32:49 PDT 2009
Author: lattner
Date: Sat Apr 25 20:32:48 2009
New Revision: 70105
URL: http://llvm.org/viewvc/llvm-project?rev=70105&view=rev
Log:
split ObjC and C++ Statements out into their own headers.
Added:
cfe/trunk/include/clang/AST/StmtObjC.h
Modified:
cfe/trunk/clang.xcodeproj/project.pbxproj
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/AST/StmtVisitor.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/Analysis/BugReporter.cpp
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
cfe/trunk/lib/Frontend/PCHWriter.cpp
cfe/trunk/lib/Sema/JumpDiagnostics.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Sat Apr 25 20:32:48 2009
@@ -583,6 +583,8 @@
DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JumpDiagnostics.cpp; path = lib/Sema/JumpDiagnostics.cpp; sourceTree = "<group>"; };
DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitPreprocessor.h; path = clang/Frontend/InitPreprocessor.h; sourceTree = "<group>"; };
DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitPreprocessor.cpp; path = lib/Frontend/InitPreprocessor.cpp; sourceTree = "<group>"; };
+ DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtObjC.h; path = clang/AST/StmtObjC.h; sourceTree = "<group>"; };
+ DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtCXX.h; path = clang/AST/StmtCXX.h; sourceTree = "<group>"; };
DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = "<group>"; tabWidth = 2; };
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = lib/AST/Decl.cpp; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
DED676D00B6C786700AAD4A3 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = Builtins.def; path = clang/AST/Builtins.def; sourceTree = "<group>"; tabWidth = 2; };
@@ -1126,7 +1128,9 @@
3547129D0C88881300B3E1D5 /* PrettyPrinter.h */,
DE6951C60C4D1F5D00A5826B /* RecordLayout.h */,
DE3452800AEF1B1800DBC861 /* Stmt.h */,
+ DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */,
DE345F210AFD347900DBC861 /* StmtNodes.def */,
+ DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */,
DE345C190AFC658B00DBC861 /* StmtVisitor.h */,
35847BE30CC7DB9000C40FFF /* StmtIterator.h */,
35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */,
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Sat Apr 25 20:32:48 2009
@@ -1157,318 +1157,6 @@
virtual child_iterator child_end();
};
-/// ObjCForCollectionStmt - This represents Objective-c's collection statement;
-/// represented as 'for (element 'in' collection-expression)' stmt.
-///
-class ObjCForCollectionStmt : public Stmt {
- enum { ELEM, COLLECTION, BODY, END_EXPR };
- Stmt* SubExprs[END_EXPR]; // SubExprs[ELEM] is an expression or declstmt.
- SourceLocation ForLoc;
- SourceLocation RParenLoc;
-public:
- ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
- SourceLocation FCL, SourceLocation RPL);
-
- Stmt *getElement() { return SubExprs[ELEM]; }
- Expr *getCollection() {
- return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
- }
- Stmt *getBody() { return SubExprs[BODY]; }
-
- const Stmt *getElement() const { return SubExprs[ELEM]; }
- const Expr *getCollection() const {
- return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
- }
- const Stmt *getBody() const { return SubExprs[BODY]; }
-
- SourceLocation getRParenLoc() const { return RParenLoc; }
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(ForLoc, SubExprs[BODY]->getLocEnd());
- }
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCForCollectionStmtClass;
- }
- static bool classof(const ObjCForCollectionStmt *) { return true; }
-
- // Iterators
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// ObjCAtCatchStmt - This represents objective-c's @catch statement.
-class ObjCAtCatchStmt : public Stmt {
-private:
- enum { BODY, NEXT_CATCH, END_EXPR };
- ParmVarDecl *ExceptionDecl;
- 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,
- ParmVarDecl *catchVarDecl,
- Stmt *atCatchStmt, Stmt *atCatchList);
-
- const Stmt *getCatchBody() const { return SubExprs[BODY]; }
- Stmt *getCatchBody() { return SubExprs[BODY]; }
-
- const ObjCAtCatchStmt *getNextCatchStmt() const {
- return static_cast<const ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
- }
- ObjCAtCatchStmt *getNextCatchStmt() {
- return static_cast<ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
- }
-
- const ParmVarDecl *getCatchParamDecl() const {
- return ExceptionDecl;
- }
- ParmVarDecl *getCatchParamDecl() {
- return ExceptionDecl;
- }
-
- SourceLocation getAtCatchLoc() const { return AtCatchLoc; }
- SourceLocation getRParenLoc() const { return RParenLoc; }
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(AtCatchLoc, SubExprs[BODY]->getLocEnd());
- }
-
- bool hasEllipsis() const { return getCatchParamDecl() == 0; }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCAtCatchStmtClass;
- }
- static bool classof(const ObjCAtCatchStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// ObjCAtFinallyStmt - This represent objective-c's @finally Statement
-class ObjCAtFinallyStmt : public Stmt {
- 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; }
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd());
- }
-
- SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; }
-
- 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();
-};
-
-/// ObjCAtTryStmt - This represent objective-c's over-all
-/// @try ... @catch ... @finally statement.
-class ObjCAtTryStmt : public Stmt {
-private:
- enum { TRY, CATCH, FINALLY, END_EXPR };
- Stmt* SubStmts[END_EXPR];
-
- SourceLocation AtTryLoc;
-public:
- ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
- Stmt *atCatchStmt,
- Stmt *atFinallyStmt)
- : Stmt(ObjCAtTryStmtClass) {
- SubStmts[TRY] = atTryStmt;
- SubStmts[CATCH] = atCatchStmt;
- SubStmts[FINALLY] = atFinallyStmt;
- AtTryLoc = atTryLoc;
- }
-
- SourceLocation getAtTryLoc() const { return AtTryLoc; }
- const Stmt *getTryBody() const { return SubStmts[TRY]; }
- Stmt *getTryBody() { return SubStmts[TRY]; }
- const ObjCAtCatchStmt *getCatchStmts() const {
- return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
- }
- ObjCAtCatchStmt *getCatchStmts() {
- return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
- }
- const ObjCAtFinallyStmt *getFinallyStmt() const {
- return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
- }
- ObjCAtFinallyStmt *getFinallyStmt() {
- return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
- }
- virtual SourceRange getSourceRange() const {
- return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd());
- }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCAtTryStmtClass;
- }
- static bool classof(const ObjCAtTryStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// ObjCAtSynchronizedStmt - This is for objective-c's @synchronized statement.
-/// Example: @synchronized (sem) {
-/// do-something;
-/// }
-///
-class ObjCAtSynchronizedStmt : public Stmt {
-private:
- enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
- Stmt* SubStmts[END_EXPR];
- SourceLocation AtSynchronizedLoc;
-
-public:
- ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
- Stmt *synchBody)
- : Stmt(ObjCAtSynchronizedStmtClass) {
- SubStmts[SYNC_EXPR] = synchExpr;
- SubStmts[SYNC_BODY] = synchBody;
- AtSynchronizedLoc = atSynchronizedLoc;
- }
-
- SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
-
- const CompoundStmt *getSynchBody() const {
- return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
- }
- CompoundStmt *getSynchBody() {
- return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
- }
-
- const Expr *getSynchExpr() const {
- return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
- }
- Expr *getSynchExpr() {
- return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
- }
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(AtSynchronizedLoc, getSynchBody()->getLocEnd());
- }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
- }
- static bool classof(const ObjCAtSynchronizedStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// ObjCAtThrowStmt - This represents objective-c's @throw statement.
-class ObjCAtThrowStmt : public Stmt {
- Stmt *Throw;
- SourceLocation AtThrowLoc;
-public:
- ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
- : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
- AtThrowLoc = atThrowLoc;
- }
-
- const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
- Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
-
- virtual SourceRange getSourceRange() const {
- if (Throw)
- return SourceRange(AtThrowLoc, Throw->getLocEnd());
- else
- return SourceRange(AtThrowLoc);
- }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjCAtThrowStmtClass;
- }
- static bool classof(const ObjCAtThrowStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// CXXCatchStmt - This represents a C++ catch block.
-class CXXCatchStmt : public Stmt {
- SourceLocation CatchLoc;
- /// The exception-declaration of the type.
- Decl *ExceptionDecl;
- /// The handler block.
- Stmt *HandlerBlock;
-
-public:
- CXXCatchStmt(SourceLocation catchLoc, Decl *exDecl, Stmt *handlerBlock)
- : Stmt(CXXCatchStmtClass), CatchLoc(catchLoc), ExceptionDecl(exDecl),
- HandlerBlock(handlerBlock) {}
-
- virtual void Destroy(ASTContext& Ctx);
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(CatchLoc, HandlerBlock->getLocEnd());
- }
-
- Decl *getExceptionDecl() { return ExceptionDecl; }
- QualType getCaughtType();
- Stmt *getHandlerBlock() { return HandlerBlock; }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == CXXCatchStmtClass;
- }
- static bool classof(const CXXCatchStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
-/// CXXTryStmt - A C++ try block, including all handlers.
-class CXXTryStmt : public Stmt {
- SourceLocation TryLoc;
- // First place is the guarded CompoundStatement. Subsequent are the handlers.
- // More than three handlers should be rare.
- llvm::SmallVector<Stmt*, 4> Stmts;
-
-public:
- CXXTryStmt(SourceLocation tryLoc, Stmt *tryBlock,
- Stmt **handlers, unsigned numHandlers);
-
- virtual SourceRange getSourceRange() const {
- return SourceRange(TryLoc, Stmts.back()->getLocEnd());
- }
-
- CompoundStmt *getTryBlock() { return llvm::cast<CompoundStmt>(Stmts[0]); }
- const CompoundStmt *getTryBlock() const {
- return llvm::cast<CompoundStmt>(Stmts[0]);
- }
-
- unsigned getNumHandlers() const { return Stmts.size() - 1; }
- CXXCatchStmt *getHandler(unsigned i) {
- return llvm::cast<CXXCatchStmt>(Stmts[i + 1]);
- }
- const CXXCatchStmt *getHandler(unsigned i) const {
- return llvm::cast<CXXCatchStmt>(Stmts[i + 1]);
- }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == CXXTryStmtClass;
- }
- static bool classof(const CXXTryStmt *) { return true; }
-
- virtual child_iterator child_begin();
- virtual child_iterator child_end();
-};
-
} // end namespace clang
#endif
Added: cfe/trunk/include/clang/AST/StmtObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtObjC.h?rev=70105&view=auto
==============================================================================
--- cfe/trunk/include/clang/AST/StmtObjC.h (added)
+++ cfe/trunk/include/clang/AST/StmtObjC.h Sat Apr 25 20:32:48 2009
@@ -0,0 +1,266 @@
+//===--- StmtObjC.h - Classes for representing ObjC statements --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the Objective-C statement AST node classes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_STMTOBJC_H
+#define LLVM_CLANG_AST_STMTOBJC_H
+
+#include "clang/AST/Stmt.h"
+
+namespace clang {
+
+/// ObjCForCollectionStmt - This represents Objective-c's collection statement;
+/// represented as 'for (element 'in' collection-expression)' stmt.
+///
+class ObjCForCollectionStmt : public Stmt {
+ enum { ELEM, COLLECTION, BODY, END_EXPR };
+ Stmt* SubExprs[END_EXPR]; // SubExprs[ELEM] is an expression or declstmt.
+ SourceLocation ForLoc;
+ SourceLocation RParenLoc;
+public:
+ ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
+ SourceLocation FCL, SourceLocation RPL);
+
+ Stmt *getElement() { return SubExprs[ELEM]; }
+ Expr *getCollection() {
+ return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
+ }
+ Stmt *getBody() { return SubExprs[BODY]; }
+
+ const Stmt *getElement() const { return SubExprs[ELEM]; }
+ const Expr *getCollection() const {
+ return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
+ }
+ const Stmt *getBody() const { return SubExprs[BODY]; }
+
+ SourceLocation getRParenLoc() const { return RParenLoc; }
+
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(ForLoc, SubExprs[BODY]->getLocEnd());
+ }
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCForCollectionStmtClass;
+ }
+ static bool classof(const ObjCForCollectionStmt *) { return true; }
+
+ // Iterators
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
+/// ObjCAtCatchStmt - This represents objective-c's @catch statement.
+class ObjCAtCatchStmt : public Stmt {
+private:
+ enum { BODY, NEXT_CATCH, END_EXPR };
+ ParmVarDecl *ExceptionDecl;
+ 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,
+ ParmVarDecl *catchVarDecl,
+ Stmt *atCatchStmt, Stmt *atCatchList);
+
+ const Stmt *getCatchBody() const { return SubExprs[BODY]; }
+ Stmt *getCatchBody() { return SubExprs[BODY]; }
+
+ const ObjCAtCatchStmt *getNextCatchStmt() const {
+ return static_cast<const ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
+ }
+ ObjCAtCatchStmt *getNextCatchStmt() {
+ return static_cast<ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
+ }
+
+ const ParmVarDecl *getCatchParamDecl() const {
+ return ExceptionDecl;
+ }
+ ParmVarDecl *getCatchParamDecl() {
+ return ExceptionDecl;
+ }
+
+ SourceLocation getAtCatchLoc() const { return AtCatchLoc; }
+ SourceLocation getRParenLoc() const { return RParenLoc; }
+
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(AtCatchLoc, SubExprs[BODY]->getLocEnd());
+ }
+
+ bool hasEllipsis() const { return getCatchParamDecl() == 0; }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCAtCatchStmtClass;
+ }
+ static bool classof(const ObjCAtCatchStmt *) { return true; }
+
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
+/// ObjCAtFinallyStmt - This represent objective-c's @finally Statement
+class ObjCAtFinallyStmt : public Stmt {
+ 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; }
+
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd());
+ }
+
+ SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; }
+
+ 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();
+};
+
+/// ObjCAtTryStmt - This represent objective-c's over-all
+/// @try ... @catch ... @finally statement.
+class ObjCAtTryStmt : public Stmt {
+private:
+ enum { TRY, CATCH, FINALLY, END_EXPR };
+ Stmt* SubStmts[END_EXPR];
+
+ SourceLocation AtTryLoc;
+public:
+ ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
+ Stmt *atCatchStmt,
+ Stmt *atFinallyStmt)
+ : Stmt(ObjCAtTryStmtClass) {
+ SubStmts[TRY] = atTryStmt;
+ SubStmts[CATCH] = atCatchStmt;
+ SubStmts[FINALLY] = atFinallyStmt;
+ AtTryLoc = atTryLoc;
+ }
+
+ SourceLocation getAtTryLoc() const { return AtTryLoc; }
+ const Stmt *getTryBody() const { return SubStmts[TRY]; }
+ Stmt *getTryBody() { return SubStmts[TRY]; }
+ const ObjCAtCatchStmt *getCatchStmts() const {
+ return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
+ }
+ ObjCAtCatchStmt *getCatchStmts() {
+ return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
+ }
+ const ObjCAtFinallyStmt *getFinallyStmt() const {
+ return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
+ }
+ ObjCAtFinallyStmt *getFinallyStmt() {
+ return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
+ }
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd());
+ }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCAtTryStmtClass;
+ }
+ static bool classof(const ObjCAtTryStmt *) { return true; }
+
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
+/// ObjCAtSynchronizedStmt - This is for objective-c's @synchronized statement.
+/// Example: @synchronized (sem) {
+/// do-something;
+/// }
+///
+class ObjCAtSynchronizedStmt : public Stmt {
+private:
+ enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
+ Stmt* SubStmts[END_EXPR];
+ SourceLocation AtSynchronizedLoc;
+
+public:
+ ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
+ Stmt *synchBody)
+ : Stmt(ObjCAtSynchronizedStmtClass) {
+ SubStmts[SYNC_EXPR] = synchExpr;
+ SubStmts[SYNC_BODY] = synchBody;
+ AtSynchronizedLoc = atSynchronizedLoc;
+ }
+
+ SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
+
+ const CompoundStmt *getSynchBody() const {
+ return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
+ }
+ CompoundStmt *getSynchBody() {
+ return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
+ }
+
+ const Expr *getSynchExpr() const {
+ return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
+ }
+ Expr *getSynchExpr() {
+ return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
+ }
+
+ virtual SourceRange getSourceRange() const {
+ return SourceRange(AtSynchronizedLoc, getSynchBody()->getLocEnd());
+ }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
+ }
+ static bool classof(const ObjCAtSynchronizedStmt *) { return true; }
+
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
+/// ObjCAtThrowStmt - This represents objective-c's @throw statement.
+class ObjCAtThrowStmt : public Stmt {
+ Stmt *Throw;
+ SourceLocation AtThrowLoc;
+public:
+ ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
+ : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
+ AtThrowLoc = atThrowLoc;
+ }
+
+ const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
+ Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
+
+ virtual SourceRange getSourceRange() const {
+ if (Throw)
+ return SourceRange(AtThrowLoc, Throw->getLocEnd());
+ else
+ return SourceRange(AtThrowLoc);
+ }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCAtThrowStmtClass;
+ }
+ static bool classof(const ObjCAtThrowStmt *) { return true; }
+
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
+} // end namespace clang
+
+#endif
Modified: cfe/trunk/include/clang/AST/StmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtVisitor.h?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtVisitor.h (original)
+++ cfe/trunk/include/clang/AST/StmtVisitor.h Sat Apr 25 20:32:48 2009
@@ -16,6 +16,8 @@
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
+#include "clang/AST/StmtCXX.h"
+#include "clang/AST/StmtObjC.h"
namespace clang {
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Sat Apr 25 20:32:48 2009
@@ -28,6 +28,7 @@
class PathDiagnosticClient;
class Diagnostic;
+ class ObjCForCollectionStmt;
class GRExprEngine {
public:
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Sat Apr 25 20:32:48 2009
@@ -14,6 +14,8 @@
#include "clang/AST/Stmt.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
+#include "clang/AST/StmtCXX.h"
+#include "clang/AST/StmtObjC.h"
#include "clang/AST/Type.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Sat Apr 25 20:32:48 2009
@@ -14,12 +14,12 @@
#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
-#include "clang/Basic/SourceManager.h"
-#include "clang/Basic/SourceLocation.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CFG.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ParentMap.h"
+#include "clang/AST/StmtObjC.h"
+#include "clang/Basic/SourceManager.h"
#include "clang/Analysis/ProgramPoint.h"
#include "clang/Analysis/PathDiagnostic.h"
#include "llvm/Support/raw_ostream.h"
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Sat Apr 25 20:32:48 2009
@@ -13,10 +13,12 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/AST/ParentMap.h"
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
#include "clang/Analysis/PathSensitive/GRExprEngineBuilders.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
+#include "clang/AST/ParentMap.h"
+#include "clang/AST/StmtObjC.h"
+#include "clang/Basic/SourceManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/PrettyStackTrace.h"
#include "llvm/Support/Streams.h"
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Sat Apr 25 20:32:48 2009
@@ -16,10 +16,10 @@
#include "CodeGenModule.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/StmtObjC.h"
#include "clang/Basic/Diagnostic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Target/TargetData.h"
-
using namespace clang;
using namespace CodeGen;
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Sat Apr 25 20:32:48 2009
@@ -20,6 +20,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/StmtObjC.h"
#include "llvm/Module.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sat Apr 25 20:32:48 2009
@@ -18,6 +18,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/StmtObjC.h"
#include "clang/Basic/LangOptions.h"
#include "llvm/Intrinsics.h"
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Sat Apr 25 20:32:48 2009
@@ -50,6 +50,10 @@
class ObjCPropertyImplDecl;
class TargetInfo;
class VarDecl;
+ class ObjCForCollectionStmt;
+ class ObjCAtTryStmt;
+ class ObjCAtThrowStmt;
+ class ObjCAtSynchronizedStmt;
namespace CodeGen {
class CodeGenModule;
Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Sat Apr 25 20:32:48 2009
@@ -1253,7 +1253,6 @@
void PCHStmtWriter::VisitObjCSuperExpr(ObjCSuperExpr *E) {
VisitExpr(E);
Writer.AddSourceLocation(E->getLoc(), Record);
-
}
Modified: cfe/trunk/lib/Sema/JumpDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/JumpDiagnostics.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/JumpDiagnostics.cpp (original)
+++ cfe/trunk/lib/Sema/JumpDiagnostics.cpp Sat Apr 25 20:32:48 2009
@@ -14,6 +14,7 @@
#include "Sema.h"
#include "clang/AST/Expr.h"
+#include "clang/AST/StmtObjC.h"
using namespace clang;
namespace {
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=70105&r1=70104&r2=70105&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Sat Apr 25 20:32:48 2009
@@ -16,7 +16,8 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
-#include "clang/AST/ASTContext.h"
+#include "clang/AST/StmtObjC.h"
+#include "clang/AST/StmtCXX.h"
#include "clang/Basic/TargetInfo.h"
using namespace clang;
More information about the cfe-commits
mailing list