[cfe-commits] r76267 - /cfe/trunk/include/clang/AST/DeclObjC.h

Argiris Kirtzidis akyrtzi at gmail.com
Fri Jul 17 17:33:16 PDT 2009


Author: akirtzidis
Date: Fri Jul 17 19:33:08 2009
New Revision: 76267

URL: http://llvm.org/viewvc/llvm-project?rev=76267&view=rev
Log:
Add getSourceRange() methods for ObjC Decls.

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h

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

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Fri Jul 17 19:33:08 2009
@@ -178,7 +178,7 @@
   SourceLocation getLocStart() const { return getLocation(); }
   SourceLocation getLocEnd() const { return EndLoc; }
   void setEndLoc(SourceLocation Loc) { EndLoc = Loc; }
-  SourceRange getSourceRange() const { 
+  virtual SourceRange getSourceRange() const { 
     return SourceRange(getLocation(), EndLoc); 
   }
     
@@ -341,6 +341,10 @@
   // Marks the end of the container.
   SourceLocation getAtEndLoc() const { return AtEndLoc; }
   void setAtEndLoc(SourceLocation L) { AtEndLoc = L; }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(getLocation(), getAtEndLoc());
+  }
   
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
@@ -484,7 +488,7 @@
   ObjCMethodDecl *lookupClassMethod(Selector Sel);
   ObjCInterfaceDecl *lookupInheritedClass(const IdentifierInfo *ICName);
 
-  // Location information, modeled after the Stmt API. 
+  // Location information, modeled after the Stmt API.
   SourceLocation getLocStart() const { return getLocation(); } // '@'interface
   SourceLocation getLocEnd() const { return EndLoc; }
   void setLocEnd(SourceLocation LE) { EndLoc = LE; };
@@ -880,6 +884,9 @@
   }
 
   // Location information, modeled after the Stmt API. 
+  virtual SourceRange getSourceRange() const { 
+    return SourceRange(getLocation(), EndLoc); 
+  }
   SourceLocation getLocStart() const { return getLocation(); }
   SourceLocation getLocEnd() const { return EndLoc; }
   void setLocEnd(SourceLocation LE) { EndLoc = LE; };
@@ -1188,6 +1195,9 @@
                                       Kind PK, 
                                       ObjCIvarDecl *ivarDecl);
 
+  virtual SourceRange getSourceRange() const { 
+    return SourceRange(AtLoc, getLocation()); 
+  }
   SourceLocation getLocStart() const { return AtLoc; }
   void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
 





More information about the cfe-commits mailing list