aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
//===----------------------------------------------------------------------===//