[cfe-commits] r89179 - in /cfe/trunk: include/clang/AST/DeclObjC.h lib/AST/DeclObjC.cpp

Ted Kremenek kremenek at apple.com
Tue Nov 17 17:26:56 PST 2009


Author: kremenek
Date: Tue Nov 17 19:26:56 2009
New Revision: 89179

URL: http://llvm.org/viewvc/llvm-project?rev=89179&view=rev
Log:
Add ObjCClassDecl::getSourceRange().

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/lib/AST/DeclObjC.cpp

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=89179&r1=89178&r2=89179&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Tue Nov 17 19:26:56 2009
@@ -744,6 +744,8 @@
                                ObjCInterfaceDecl *const *Elts = 0,
                                const SourceLocation *Locs = 0,
                                unsigned nElts = 0);
+  
+  virtual SourceRange getSourceRange() const;
 
   typedef const ObjCClassRef* iterator;
   iterator begin() const { return ForwardDecls; }

Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=89179&r1=89178&r2=89179&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Tue Nov 17 19:26:56 2009
@@ -614,6 +614,12 @@
   Decl::Destroy(C);
 }
 
+SourceRange ObjCClassDecl::getSourceRange() const {
+  // FIXME: We should include the semicolon
+  assert(NumDecls);
+  return SourceRange(getLocation(), ForwardDecls[NumDecls-1].getLocation());
+}
+
 //===----------------------------------------------------------------------===//
 // ObjCForwardProtocolDecl
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list