summaryrefslogtreecommitdiffstats
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
commit49939c2914da85d3c85163800a4223a38dc70ddf (patch)
tree2408d9ecb38d87ce801914d6feab0bc542b0a162
parentdfd8daaf61a9037cb80b51fd4c944cb225feb633 (diff)
downloadbcm5719-llvm-49939c2914da85d3c85163800a4223a38dc70ddf.tar.gz
bcm5719-llvm-49939c2914da85d3c85163800a4223a38dc70ddf.zip
Add ObjCClassDecl::getSourceRange().
llvm-svn: 89179
-rw-r--r--clang/include/clang/AST/DeclObjC.h2
-rw-r--r--clang/lib/AST/DeclObjC.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 0d4089623d2..13193ffab55 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/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/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 9d43c7cca0a..c33720f5633 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/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
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud