]> granicus.if.org Git - clang/commitdiff
Add ObjCClassDecl::getSourceRange().
authorTed Kremenek <kremenek@apple.com>
Wed, 18 Nov 2009 01:26:56 +0000 (01:26 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 18 Nov 2009 01:26:56 +0000 (01:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp

index 0d4089623d206f6e5845329ebfecbcafd9ff6b81..13193ffab55edcffb2b055a08c0bf5e260deb51c 100644 (file)
@@ -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; }
index 9d43c7cca0a8e6ff95bd44d563a37041d4d7b8ce..c33720f5633a915a9a3600027d5aaac45dec1fc9 100644 (file)
@@ -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
 //===----------------------------------------------------------------------===//