[cfe-commits] r51703 - in /cfe/trunk: include/clang/AST/AST.h include/clang/AST/Expr.h include/clang/AST/ExprObjC.h include/clang/AST/StmtVisitor.h include/clang/Analysis/PathSensitive/GRExprEngine.h include/clang/Analysis/PathSensitive/GRTransferFuncs.h lib/AST/CFG.cpp lib/AST/Expr.cpp lib/AST/Stmt.cpp lib/AST/StmtPrinter.cpp lib/AST/StmtSerialization.cpp lib/Analysis/BasicObjCFoundationChecks.cpp lib/CodeGen/CGObjC.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprObjC.cpp

Steve Naroff snaroff at apple.com
Thu May 29 14:12:09 PDT 2008


Author: snaroff
Date: Thu May 29 16:12:08 2008
New Revision: 51703

URL: http://llvm.org/viewvc/llvm-project?rev=51703&view=rev
Log:
- Move ObjC Expresssion AST's from Expr.h => ExprObjC.h
- #include ExprObjC.h in many places

Added:
    cfe/trunk/include/clang/AST/ExprObjC.h
Modified:
    cfe/trunk/include/clang/AST/AST.h
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/include/clang/AST/StmtVisitor.h
    cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
    cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
    cfe/trunk/lib/AST/CFG.cpp
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/AST/Stmt.cpp
    cfe/trunk/lib/AST/StmtPrinter.cpp
    cfe/trunk/lib/AST/StmtSerialization.cpp
    cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
    cfe/trunk/lib/CodeGen/CGObjC.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/lib/Sema/SemaExprObjC.cpp

Modified: cfe/trunk/include/clang/AST/AST.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/AST.h?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/AST.h (original)
+++ cfe/trunk/include/clang/AST/AST.h Thu May 29 16:12:08 2008
@@ -19,6 +19,7 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/StmtVisitor.h"
 

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu May 29 16:12:08 2008
@@ -1390,285 +1390,6 @@
   InitListExpr() : Expr(InitListExprClass, QualType()) {}
 };
 
-/// ObjCStringLiteral, used for Objective-C string literals
-/// i.e. @"foo".
-class ObjCStringLiteral : public Expr {
-  StringLiteral *String;
-  SourceLocation AtLoc;
-public:
-  ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)
-    : Expr(ObjCStringLiteralClass, T), String(SL), AtLoc(L) {}
-  
-  StringLiteral* getString() { return String; }
-
-  const StringLiteral* getString() const { return String; }
-
-  SourceLocation getAtLoc() const { return AtLoc; }
-
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(AtLoc, String->getLocEnd());
-  }
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCStringLiteralClass; 
-  }
-  static bool classof(const ObjCStringLiteral *) { return true; }  
-  
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-  
-  virtual void EmitImpl(llvm::Serializer& S) const;
-  static ObjCStringLiteral* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-  
-/// ObjCEncodeExpr, used for @encode in Objective-C.
-class ObjCEncodeExpr : public Expr {
-  QualType EncType;
-  SourceLocation AtLoc, RParenLoc;
-public:
-  ObjCEncodeExpr(QualType T, QualType ET, 
-                 SourceLocation at, SourceLocation rp)
-    : Expr(ObjCEncodeExprClass, T), EncType(ET), AtLoc(at), RParenLoc(rp) {}
-  
-  SourceLocation getAtLoc() const { return AtLoc; }
-  SourceLocation getRParenLoc() const { return RParenLoc; }
-  
-  virtual SourceRange getSourceRange() const {
-    return SourceRange(AtLoc, RParenLoc);
-  }
-
-  QualType getEncodedType() const { return EncType; }
-
-  static bool classof(const Stmt *T) {
-    return T->getStmtClass() == ObjCEncodeExprClass;
-  }
-  static bool classof(const ObjCEncodeExpr *) { return true; }
-  
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-  
-  virtual void EmitImpl(llvm::Serializer& S) const;
-  static ObjCEncodeExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-
-/// ObjCSelectorExpr used for @selector in Objective-C.
-class ObjCSelectorExpr : public Expr {
-  Selector SelName;
-  SourceLocation AtLoc, RParenLoc;
-public:
-  ObjCSelectorExpr(QualType T, Selector selInfo,
-                   SourceLocation at, SourceLocation rp)
-  : Expr(ObjCSelectorExprClass, T), SelName(selInfo), 
-  AtLoc(at), RParenLoc(rp) {}
-  
-  Selector getSelector() const { return SelName; }
-  
-  SourceLocation getAtLoc() const { return AtLoc; }
-  SourceLocation getRParenLoc() const { return RParenLoc; }
-
-  virtual SourceRange getSourceRange() const {
-    return SourceRange(AtLoc, RParenLoc);
-  }
-  
-  /// getNumArgs - Return the number of actual arguments to this call.
-  unsigned getNumArgs() const { return SelName.getNumArgs(); }
-  
-  static bool classof(const Stmt *T) {
-    return T->getStmtClass() == ObjCSelectorExprClass;
-  }
-  static bool classof(const ObjCSelectorExpr *) { return true; }
-  
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-
-  virtual void EmitImpl(llvm::Serializer& S) const;
-  static ObjCSelectorExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-  
-/// ObjCProtocolExpr used for protocol in Objective-C.
-class ObjCProtocolExpr : public Expr {    
-  ObjCProtocolDecl *Protocol;    
-  SourceLocation AtLoc, RParenLoc;
-public:
-  ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol,
-                   SourceLocation at, SourceLocation rp)
-  : Expr(ObjCProtocolExprClass, T), Protocol(protocol), 
-  AtLoc(at), RParenLoc(rp) {}
-    
-  ObjCProtocolDecl *getProtocol() const { return Protocol; }
-    
-  SourceLocation getAtLoc() const { return AtLoc; }
-  SourceLocation getRParenLoc() const { return RParenLoc; }
-
-  virtual SourceRange getSourceRange() const {
-    return SourceRange(AtLoc, RParenLoc);
-  }
-        
-  static bool classof(const Stmt *T) {
-    return T->getStmtClass() == ObjCProtocolExprClass;
-  }
-  static bool classof(const ObjCProtocolExpr *) { return true; }
-    
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-};
-
-/// ObjCIvarRefExpr - A reference to an ObjC instance variable.
-class ObjCIvarRefExpr : public Expr {
-  class ObjCIvarDecl *D; 
-  SourceLocation Loc;
-  Expr *Base;
-  bool IsArrow:1;      // True if this is "X->F", false if this is "X.F".
-  bool IsFreeIvar:1;   // True if ivar reference has no base (self assumed).
-  
-public:
-  ObjCIvarRefExpr(ObjCIvarDecl *d, QualType t, SourceLocation l, Expr *base=0, 
-                  bool arrow = false, bool freeIvar = false) : 
-    Expr(ObjCIvarRefExprClass, t), D(d), Loc(l), Base(base), IsArrow(arrow),
-    IsFreeIvar(freeIvar) {}
-  
-  ObjCIvarDecl *getDecl() { return D; }
-  const ObjCIvarDecl *getDecl() const { return D; }
-  virtual SourceRange getSourceRange() const { 
-    return isFreeIvar() ? SourceRange(Loc)
-                        : SourceRange(getBase()->getLocStart(), Loc); 
-  }
-  const Expr *getBase() const { return Base; }
-  Expr *getBase() { return Base; }
-  void setBase(Expr * base) { Base = base; }
-  bool isArrow() const { return IsArrow; }
-  bool isFreeIvar() const { return IsFreeIvar; }
-  
-  SourceLocation getLocation() const { return Loc; }
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCIvarRefExprClass; 
-  }
-  static bool classof(const ObjCIvarRefExpr *) { return true; }
-  
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-  
-  virtual void EmitImpl(llvm::Serializer& S) const;
-  static ObjCIvarRefExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-
-class ObjCMessageExpr : public Expr {
-  enum { RECEIVER=0, ARGS_START=1 };
-
-  Expr **SubExprs;
-  
-  unsigned NumArgs;
-  
-  // A unigue name for this message.
-  Selector SelName;
-  
-  // A method prototype for this message (optional). 
-  // FIXME: Since method decls contain the selector, and most messages have a
-  // prototype, consider devising a scheme for unifying SelName/MethodProto.
-  ObjCMethodDecl *MethodProto;
-
-  SourceLocation LBracloc, RBracloc;
-  
-  // constructor used during deserialization
-  ObjCMessageExpr(Selector selInfo, QualType retType,
-                  SourceLocation LBrac, SourceLocation RBrac,
-                  Expr **ArgExprs, unsigned nargs)
-  : Expr(ObjCMessageExprClass, retType), NumArgs(nargs), SelName(selInfo),
-    MethodProto(NULL), LBracloc(LBrac), RBracloc(RBrac) {}
-  
-public:
-  // constructor for class messages. 
-  // FIXME: clsName should be typed to ObjCInterfaceType
-  ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo,
-                  QualType retType, ObjCMethodDecl *methDecl,
-                  SourceLocation LBrac, SourceLocation RBrac,
-                  Expr **ArgExprs, unsigned NumArgs);
-  // constructor for instance messages.
-  ObjCMessageExpr(Expr *receiver, Selector selInfo,
-                  QualType retType, ObjCMethodDecl *methDecl,
-                  SourceLocation LBrac, SourceLocation RBrac,
-                  Expr **ArgExprs, unsigned NumArgs);
-  
-  ~ObjCMessageExpr() {
-    delete [] SubExprs;
-  }
-  
-  /// getReceiver - Returns the receiver of the message expression.
-  ///  This can be NULL if the message is for instance methods.  For
-  ///  instance methods, use getClassName.
-  Expr *getReceiver() { 
-    uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
-    return x & 0x1 ? NULL : (Expr*) x;
-  }  
-  const Expr *getReceiver() const {
-    return const_cast<ObjCMessageExpr*>(this)->getReceiver();
-  }
-  
-  Selector getSelector() const { return SelName; }
-
-  const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
-  ObjCMethodDecl *getMethodDecl() { return MethodProto; }
-  
-  /// getClassName - For instance methods, this returns the invoked class,
-  ///  and returns NULL otherwise.  For regular methods, use getReceiver.  
-  IdentifierInfo *getClassName() {
-    uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
-    return x & 0x1 ? (IdentifierInfo*) (x & ~0x1) : NULL;
-  }  
-  const IdentifierInfo *getClassName() const {
-    return const_cast<ObjCMessageExpr*>(this)->getClassName();
-  }
-  
-  /// getNumArgs - Return the number of actual arguments to this call.
-  unsigned getNumArgs() const { return NumArgs; }
-
-  /// getArg - Return the specified argument.
-  Expr *getArg(unsigned Arg) {
-    assert(Arg < NumArgs && "Arg access out of range!");
-    return SubExprs[Arg+ARGS_START];
-  }
-  const Expr *getArg(unsigned Arg) const {
-    assert(Arg < NumArgs && "Arg access out of range!");
-    return SubExprs[Arg+ARGS_START];
-  }
-  /// setArg - Set the specified argument.
-  void setArg(unsigned Arg, Expr *ArgExpr) {
-    assert(Arg < NumArgs && "Arg access out of range!");
-    SubExprs[Arg+ARGS_START] = ArgExpr;
-  }
-
-  virtual SourceRange getSourceRange() const {
-    return SourceRange(LBracloc, RBracloc);
-  }
-
-  static bool classof(const Stmt *T) {
-    return T->getStmtClass() == ObjCMessageExprClass;
-  }
-  static bool classof(const ObjCMessageExpr *) { return true; }
-  
-  // Iterators
-  virtual child_iterator child_begin();
-  virtual child_iterator child_end();
-  
-  typedef Expr** arg_iterator;
-  typedef const Expr* const* const_arg_iterator;
-  
-  arg_iterator arg_begin() { return &SubExprs[ARGS_START]; }
-  arg_iterator arg_end()   { return arg_begin() + NumArgs; }
-  const_arg_iterator arg_begin() const { return &SubExprs[ARGS_START]; }
-  const_arg_iterator arg_end() const { return arg_begin() + NumArgs; }
-  
-  // Serialization.
-  virtual void EmitImpl(llvm::Serializer& S) const;
-  static ObjCMessageExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
-};
-
 }  // end namespace clang
 
 #endif

Added: cfe/trunk/include/clang/AST/ExprObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=51703&view=auto

==============================================================================
--- cfe/trunk/include/clang/AST/ExprObjC.h (added)
+++ cfe/trunk/include/clang/AST/ExprObjC.h Thu May 29 16:12:08 2008
@@ -0,0 +1,305 @@
+//===--- ExprObjC.h - Classes for representing ObjC expressions -*- 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 ExprObjC interface and subclasses.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_EXPROBJC_H
+#define LLVM_CLANG_AST_EXPROBJC_H
+
+#include "clang/AST/Expr.h"
+
+namespace clang {
+  class IdentifierInfo;
+  class Selector;
+  class ASTContext;
+  
+/// ObjCStringLiteral, used for Objective-C string literals
+/// i.e. @"foo".
+class ObjCStringLiteral : public Expr {
+  StringLiteral *String;
+  SourceLocation AtLoc;
+public:
+  ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)
+    : Expr(ObjCStringLiteralClass, T), String(SL), AtLoc(L) {}
+  
+  StringLiteral* getString() { return String; }
+
+  const StringLiteral* getString() const { return String; }
+
+  SourceLocation getAtLoc() const { return AtLoc; }
+
+  virtual SourceRange getSourceRange() const { 
+    return SourceRange(AtLoc, String->getLocEnd());
+  }
+  
+  static bool classof(const Stmt *T) { 
+    return T->getStmtClass() == ObjCStringLiteralClass; 
+  }
+  static bool classof(const ObjCStringLiteral *) { return true; }  
+  
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+  
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjCStringLiteral* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+};
+  
+/// ObjCEncodeExpr, used for @encode in Objective-C.
+class ObjCEncodeExpr : public Expr {
+  QualType EncType;
+  SourceLocation AtLoc, RParenLoc;
+public:
+  ObjCEncodeExpr(QualType T, QualType ET, 
+                 SourceLocation at, SourceLocation rp)
+    : Expr(ObjCEncodeExprClass, T), EncType(ET), AtLoc(at), RParenLoc(rp) {}
+  
+  SourceLocation getAtLoc() const { return AtLoc; }
+  SourceLocation getRParenLoc() const { return RParenLoc; }
+  
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
+
+  QualType getEncodedType() const { return EncType; }
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCEncodeExprClass;
+  }
+  static bool classof(const ObjCEncodeExpr *) { return true; }
+  
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+  
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjCEncodeExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+};
+
+/// ObjCSelectorExpr used for @selector in Objective-C.
+class ObjCSelectorExpr : public Expr {
+  Selector SelName;
+  SourceLocation AtLoc, RParenLoc;
+public:
+  ObjCSelectorExpr(QualType T, Selector selInfo,
+                   SourceLocation at, SourceLocation rp)
+  : Expr(ObjCSelectorExprClass, T), SelName(selInfo), 
+  AtLoc(at), RParenLoc(rp) {}
+  
+  Selector getSelector() const { return SelName; }
+  
+  SourceLocation getAtLoc() const { return AtLoc; }
+  SourceLocation getRParenLoc() const { return RParenLoc; }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
+  
+  /// getNumArgs - Return the number of actual arguments to this call.
+  unsigned getNumArgs() const { return SelName.getNumArgs(); }
+  
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCSelectorExprClass;
+  }
+  static bool classof(const ObjCSelectorExpr *) { return true; }
+  
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjCSelectorExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+};
+  
+/// ObjCProtocolExpr used for protocol in Objective-C.
+class ObjCProtocolExpr : public Expr {    
+  ObjCProtocolDecl *Protocol;    
+  SourceLocation AtLoc, RParenLoc;
+public:
+  ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol,
+                   SourceLocation at, SourceLocation rp)
+  : Expr(ObjCProtocolExprClass, T), Protocol(protocol), 
+  AtLoc(at), RParenLoc(rp) {}
+    
+  ObjCProtocolDecl *getProtocol() const { return Protocol; }
+    
+  SourceLocation getAtLoc() const { return AtLoc; }
+  SourceLocation getRParenLoc() const { return RParenLoc; }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
+        
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCProtocolExprClass;
+  }
+  static bool classof(const ObjCProtocolExpr *) { return true; }
+    
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+};
+
+/// ObjCIvarRefExpr - A reference to an ObjC instance variable.
+class ObjCIvarRefExpr : public Expr {
+  class ObjCIvarDecl *D; 
+  SourceLocation Loc;
+  Expr *Base;
+  bool IsArrow:1;      // True if this is "X->F", false if this is "X.F".
+  bool IsFreeIvar:1;   // True if ivar reference has no base (self assumed).
+  
+public:
+  ObjCIvarRefExpr(ObjCIvarDecl *d, QualType t, SourceLocation l, Expr *base=0, 
+                  bool arrow = false, bool freeIvar = false) : 
+    Expr(ObjCIvarRefExprClass, t), D(d), Loc(l), Base(base), IsArrow(arrow),
+    IsFreeIvar(freeIvar) {}
+  
+  ObjCIvarDecl *getDecl() { return D; }
+  const ObjCIvarDecl *getDecl() const { return D; }
+  virtual SourceRange getSourceRange() const { 
+    return isFreeIvar() ? SourceRange(Loc)
+                        : SourceRange(getBase()->getLocStart(), Loc); 
+  }
+  const Expr *getBase() const { return Base; }
+  Expr *getBase() { return Base; }
+  void setBase(Expr * base) { Base = base; }
+  bool isArrow() const { return IsArrow; }
+  bool isFreeIvar() const { return IsFreeIvar; }
+  
+  SourceLocation getLocation() const { return Loc; }
+  
+  static bool classof(const Stmt *T) { 
+    return T->getStmtClass() == ObjCIvarRefExprClass; 
+  }
+  static bool classof(const ObjCIvarRefExpr *) { return true; }
+  
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+  
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjCIvarRefExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+};
+
+class ObjCMessageExpr : public Expr {
+  enum { RECEIVER=0, ARGS_START=1 };
+
+  Expr **SubExprs;
+  
+  unsigned NumArgs;
+  
+  // A unigue name for this message.
+  Selector SelName;
+  
+  // A method prototype for this message (optional). 
+  // FIXME: Since method decls contain the selector, and most messages have a
+  // prototype, consider devising a scheme for unifying SelName/MethodProto.
+  ObjCMethodDecl *MethodProto;
+
+  SourceLocation LBracloc, RBracloc;
+  
+  // constructor used during deserialization
+  ObjCMessageExpr(Selector selInfo, QualType retType,
+                  SourceLocation LBrac, SourceLocation RBrac,
+                  Expr **ArgExprs, unsigned nargs)
+  : Expr(ObjCMessageExprClass, retType), NumArgs(nargs), SelName(selInfo),
+    MethodProto(NULL), LBracloc(LBrac), RBracloc(RBrac) {}
+  
+public:
+  // constructor for class messages. 
+  // FIXME: clsName should be typed to ObjCInterfaceType
+  ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo,
+                  QualType retType, ObjCMethodDecl *methDecl,
+                  SourceLocation LBrac, SourceLocation RBrac,
+                  Expr **ArgExprs, unsigned NumArgs);
+  // constructor for instance messages.
+  ObjCMessageExpr(Expr *receiver, Selector selInfo,
+                  QualType retType, ObjCMethodDecl *methDecl,
+                  SourceLocation LBrac, SourceLocation RBrac,
+                  Expr **ArgExprs, unsigned NumArgs);
+  
+  ~ObjCMessageExpr() {
+    delete [] SubExprs;
+  }
+  
+  /// getReceiver - Returns the receiver of the message expression.
+  ///  This can be NULL if the message is for instance methods.  For
+  ///  instance methods, use getClassName.
+  Expr *getReceiver() { 
+    uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
+    return x & 0x1 ? NULL : (Expr*) x;
+  }  
+  const Expr *getReceiver() const {
+    return const_cast<ObjCMessageExpr*>(this)->getReceiver();
+  }
+  
+  Selector getSelector() const { return SelName; }
+
+  const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
+  ObjCMethodDecl *getMethodDecl() { return MethodProto; }
+  
+  /// getClassName - For instance methods, this returns the invoked class,
+  ///  and returns NULL otherwise.  For regular methods, use getReceiver.  
+  IdentifierInfo *getClassName() {
+    uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
+    return x & 0x1 ? (IdentifierInfo*) (x & ~0x1) : NULL;
+  }  
+  const IdentifierInfo *getClassName() const {
+    return const_cast<ObjCMessageExpr*>(this)->getClassName();
+  }
+  
+  /// getNumArgs - Return the number of actual arguments to this call.
+  unsigned getNumArgs() const { return NumArgs; }
+
+  /// getArg - Return the specified argument.
+  Expr *getArg(unsigned Arg) {
+    assert(Arg < NumArgs && "Arg access out of range!");
+    return SubExprs[Arg+ARGS_START];
+  }
+  const Expr *getArg(unsigned Arg) const {
+    assert(Arg < NumArgs && "Arg access out of range!");
+    return SubExprs[Arg+ARGS_START];
+  }
+  /// setArg - Set the specified argument.
+  void setArg(unsigned Arg, Expr *ArgExpr) {
+    assert(Arg < NumArgs && "Arg access out of range!");
+    SubExprs[Arg+ARGS_START] = ArgExpr;
+  }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(LBracloc, RBracloc);
+  }
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCMessageExprClass;
+  }
+  static bool classof(const ObjCMessageExpr *) { return true; }
+  
+  // Iterators
+  virtual child_iterator child_begin();
+  virtual child_iterator child_end();
+  
+  typedef Expr** arg_iterator;
+  typedef const Expr* const* const_arg_iterator;
+  
+  arg_iterator arg_begin() { return &SubExprs[ARGS_START]; }
+  arg_iterator arg_end()   { return arg_begin() + NumArgs; }
+  const_arg_iterator arg_begin() const { return &SubExprs[ARGS_START]; }
+  const_arg_iterator arg_end() const { return arg_begin() + NumArgs; }
+  
+  // Serialization.
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjCMessageExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+};
+
+}  // 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=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/StmtVisitor.h (original)
+++ cfe/trunk/include/clang/AST/StmtVisitor.h Thu May 29 16:12:08 2008
@@ -15,6 +15,7 @@
 #define LLVM_CLANG_AST_STMTVISITOR_H
 
 #include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.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=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Thu May 29 16:12:08 2008
@@ -21,13 +21,14 @@
 #include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h"
 #include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
 #include "clang/AST/Type.h"
+#include "clang/AST/ExprObjC.h"
 
 namespace clang {  
   
   class BugType;
   class PathDiagnosticClient;
   class Diagnostic;
-  
+
 class GRExprEngine {
   
 public:

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h Thu May 29 16:12:08 2008
@@ -22,6 +22,7 @@
 namespace clang {
   
   class GRExprEngine;
+  class ObjCMessageExpr;
   
 class GRTransferFuncs {
 public:

Modified: cfe/trunk/lib/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CFG.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/AST/CFG.cpp (original)
+++ cfe/trunk/lib/AST/CFG.cpp Thu May 29 16:12:08 2008
@@ -13,7 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/AST/CFG.h"
-#include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/AST/PrettyPrinter.h"
 #include "llvm/ADT/DenseMap.h"

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu May 29 16:12:08 2008
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Basic/IdentifierTable.h"

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Thu May 29 16:12:08 2008
@@ -13,6 +13,7 @@
 
 #include "clang/AST/Stmt.h"
 #include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Basic/IdentifierTable.h"
 using namespace clang;

Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Thu May 29 16:12:08 2008
@@ -16,6 +16,7 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/PrettyPrinter.h"
 #include "clang/Basic/IdentifierTable.h"
 #include "llvm/Support/Compiler.h"

Modified: cfe/trunk/lib/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtSerialization.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/lib/AST/StmtSerialization.cpp Thu May 29 16:12:08 2008
@@ -14,6 +14,7 @@
 
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.h"
 #include "llvm/Bitcode/Serialize.h"
 #include "llvm/Bitcode/Deserialize.h"
 

Modified: cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp Thu May 29 16:12:08 2008
@@ -21,6 +21,7 @@
 #include "clang/Analysis/PathSensitive/BugReporter.h"
 #include "clang/Analysis/PathDiagnostic.h"
 #include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/ASTContext.h"
 #include "llvm/Support/Compiler.h"
 

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Thu May 29 16:12:08 2008
@@ -14,7 +14,7 @@
 #include "CGObjCRuntime.h"
 #include "CodeGenFunction.h"
 #include "CodeGenModule.h"
-#include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "llvm/Constant.h"
 using namespace clang;
 using namespace CodeGen;

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu May 29 16:12:08 2008
@@ -15,6 +15,7 @@
 #include "clang/Basic/LangOptions.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/AST/Type.h"
 #include "clang/Parse/Scope.h"

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu May 29 16:12:08 2008
@@ -16,6 +16,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.h"
 #include "clang/Parse/DeclSpec.h" 
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/LiteralSupport.h"

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=51703&r1=51702&r2=51703&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Thu May 29 16:12:08 2008
@@ -14,7 +14,7 @@
 #include "Sema.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
-#include "clang/AST/Expr.h"
+#include "clang/AST/ExprObjC.h"
 using namespace clang;
 
 Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, 





More information about the cfe-commits mailing list