aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-18 01:26:56 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-18 01:26:56 +0000
commit2dbdd622d02d1bfbe1e5bcf421b07b74c7a748f1 (patch)
treece66eda8b06bd09d034736764ae78d3d01d3954d
parent4bf8152799ec41796f989ea1b94f6f1bac349117 (diff)
Add ObjCClassDecl::getSourceRange().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclObjC.h2
-rw-r--r--lib/AST/DeclObjC.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index 0d4089623d..13193ffab5 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -744,6 +744,8 @@ public:
ObjCInterfaceDecl *const *Elts = 0,
const SourceLocation *Locs = 0,
unsigned nElts = 0);
+
+ virtual SourceRange getSourceRange() const;
typedef const ObjCClassRef* iterator;
iterator begin() const { return ForwardDecls; }
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 9d43c7cca0..c33720f563 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -614,6 +614,12 @@ void ObjCClassDecl::Destroy(ASTContext &C) {
Decl::Destroy(C);
}
+SourceRange ObjCClassDecl::getSourceRange() const {
+ // FIXME: We should include the semicolon
+ assert(NumDecls);
+ return SourceRange(getLocation(), ForwardDecls[NumDecls-1].getLocation());
+}
+
//===----------------------------------------------------------------------===//
// ObjCForwardProtocolDecl
//===----------------------------------------------------------------------===//