Add getSourceRange() methods for ObjC Decls.

llvm-svn: 76267
This commit is contained in:
Argyrios Kyrtzidis 2009-07-18 00:33:08 +00:00
parent f56501ce48
commit ce55b2e543
1 changed files with 12 additions and 2 deletions

View File

@ -178,7 +178,7 @@ public:
SourceLocation getLocStart() const { return getLocation(); } SourceLocation getLocStart() const { return getLocation(); }
SourceLocation getLocEnd() const { return EndLoc; } SourceLocation getLocEnd() const { return EndLoc; }
void setEndLoc(SourceLocation Loc) { EndLoc = Loc; } void setEndLoc(SourceLocation Loc) { EndLoc = Loc; }
SourceRange getSourceRange() const { virtual SourceRange getSourceRange() const {
return SourceRange(getLocation(), EndLoc); return SourceRange(getLocation(), EndLoc);
} }
@ -342,6 +342,10 @@ public:
SourceLocation getAtEndLoc() const { return AtEndLoc; } SourceLocation getAtEndLoc() const { return AtEndLoc; }
void setAtEndLoc(SourceLocation L) { AtEndLoc = L; } void setAtEndLoc(SourceLocation L) { AtEndLoc = L; }
virtual SourceRange getSourceRange() const {
return SourceRange(getLocation(), getAtEndLoc());
}
// Implement isa/cast/dyncast/etc. // Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { static bool classof(const Decl *D) {
return D->getKind() >= ObjCContainerFirst && return D->getKind() >= ObjCContainerFirst &&
@ -880,6 +884,9 @@ public:
} }
// Location information, modeled after the Stmt API. // Location information, modeled after the Stmt API.
virtual SourceRange getSourceRange() const {
return SourceRange(getLocation(), EndLoc);
}
SourceLocation getLocStart() const { return getLocation(); } SourceLocation getLocStart() const { return getLocation(); }
SourceLocation getLocEnd() const { return EndLoc; } SourceLocation getLocEnd() const { return EndLoc; }
void setLocEnd(SourceLocation LE) { EndLoc = LE; }; void setLocEnd(SourceLocation LE) { EndLoc = LE; };
@ -1188,6 +1195,9 @@ public:
Kind PK, Kind PK,
ObjCIvarDecl *ivarDecl); ObjCIvarDecl *ivarDecl);
virtual SourceRange getSourceRange() const {
return SourceRange(AtLoc, getLocation());
}
SourceLocation getLocStart() const { return AtLoc; } SourceLocation getLocStart() const { return AtLoc; }
void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }