]> granicus.if.org Git - clang/commitdiff
Add getSourceRange() methods for ObjC Decls.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jul 2009 00:33:08 +0000 (00:33 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jul 2009 00:33:08 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76267 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h

index c6b7910c7d7ce2bcc9a9539a6a287a2a7fa40d71..ded2fc97725f259021ae7b2ed8b47637e0772429 100644 (file)
@@ -178,7 +178,7 @@ public:
   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 @@ public:
   // 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 @@ public:
   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 @@ public:
   }
 
   // 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 @@ public:
                                       Kind PK, 
                                       ObjCIvarDecl *ivarDecl);
 
+  virtual SourceRange getSourceRange() const { 
+    return SourceRange(AtLoc, getLocation()); 
+  }
   SourceLocation getLocStart() const { return AtLoc; }
   void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }