[cfe-commits] r44939 - /cfe/trunk/include/clang/AST/DeclObjC.h

Chris Lattner sabre at nondot.org
Wed Dec 12 10:02:31 PST 2007


Author: lattner
Date: Wed Dec 12 12:02:31 2007
New Revision: 44939

URL: http://llvm.org/viewvc/llvm-project?rev=44939&view=rev
Log:
handle the -1'ness of undefined lists

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

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

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Dec 12 12:02:31 2007
@@ -126,13 +126,13 @@
   typedef ObjcMethodDecl * const * instmeth_iterator;
   instmeth_iterator instmeth_begin() const { return InstanceMethods; }
   instmeth_iterator instmeth_end() const {
-    return InstanceMethods+NumInstanceMethods;
+    return InstanceMethods+(NumInstanceMethods == -1 ? 0 : NumInstanceMethods);
   }
   
   typedef ObjcMethodDecl * const * classmeth_iterator;
   classmeth_iterator classmeth_begin() const { return ClassMethods; }
   classmeth_iterator classmeth_end() const {
-    return ClassMethods+NumClassMethods;
+    return ClassMethods+(NumClassMethods == -1 ? 0 : NumClassMethods);
   }
   
   void addInstanceVariablesToClass(ObjcIvarDecl **ivars, unsigned numIvars,
@@ -620,7 +620,7 @@
   
   typedef ObjcIvarDecl * const *ivar_iterator;
   ivar_iterator ivar_begin() const { return Ivars; }
-  ivar_iterator ivar_end() const { return Ivars+NumIvars; }
+  ivar_iterator ivar_end() const {return Ivars+(NumIvars == -1 ? 0 : NumIvars);}
   
   static bool classof(const Decl *D) {
     return D->getKind() == ObjcImplementation;





More information about the cfe-commits mailing list