]> granicus.if.org Git - clang/commitdiff
Improve documentation.
authorAdrian Prantl <aprantl@apple.com>
Fri, 7 Jun 2013 01:10:41 +0000 (01:10 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 7 Jun 2013 01:10:41 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183473 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index f90a609b4361ce3b4d227a21c815c2458e34f59f..86b5075ac22d2d8be8009356b0a9ba95cc77abd8 100644 (file)
@@ -1947,13 +1947,19 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit, bool D
   return Res;
 }
 
-/// Currently the checksum merely consists of the number of ivars.
+/// Currently the checksum of an interface includes the number of
+/// ivars and property accessors.
 unsigned CGDebugInfo::Checksum(const ObjCInterfaceDecl
-                               *InterfaceDecl) {
-  unsigned IvarNo = 0;
-  for (const ObjCIvarDecl *Ivar = InterfaceDecl->all_declared_ivar_begin();
-       Ivar != 0; Ivar = Ivar->getNextIvar()) ++IvarNo;
-  return IvarNo;
+                               *ID) {
+  // The assumption is that the number of ivars and property accessors
+  // can only increase monotonically, so it is safe to just use the
+  // sum of these as a checksum.
+  unsigned Sum = 0;
+  for (const ObjCIvarDecl *Ivar = ID->all_declared_ivar_begin();
+       Ivar != 0; Ivar = Ivar->getNextIvar())
+    ++Sum;
+
+  return Sum;
 }
 
 ObjCInterfaceDecl *CGDebugInfo::getObjCInterfaceDecl(QualType Ty) {