From: Ted Kremenek Date: Wed, 18 Nov 2009 01:26:56 +0000 (+0000) Subject: Add ObjCClassDecl::getSourceRange(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2dbdd622d02d1bfbe1e5bcf421b07b74c7a748f1;p=clang Add ObjCClassDecl::getSourceRange(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 //===----------------------------------------------------------------------===//