aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-18 00:33:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-18 00:33:08 +0000
commitddfd4c9eda34765b08fae4cb31ad5a365face107 (patch)
tree499a0a5e3f0aefd06d3e68e069aa3904362acc7f
parentad64e024bd18cf25dcfa44e049004371838decd8 (diff)
Add getSourceRange() methods for ObjC Decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76267 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclObjC.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index c6b7910c7d..ded2fc9772 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -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; }