From 2dbdd622d02d1bfbe1e5bcf421b07b74c7a748f1 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 18 Nov 2009 01:26:56 +0000 Subject: [PATCH] Add ObjCClassDecl::getSourceRange(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclObjC.h | 2 ++ lib/AST/DeclObjC.cpp | 6 ++++++ 2 files changed, 8 insertions(+) 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 //===----------------------------------------------------------------------===// -- 2.50.1