r183473 - Improve documentation.
Adrian Prantl
aprantl at apple.com
Thu Jun 6 18:10:41 PDT 2013
Author: adrian
Date: Thu Jun 6 20:10:41 2013
New Revision: 183473
URL: http://llvm.org/viewvc/llvm-project?rev=183473&view=rev
Log:
Improve documentation.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=183473&r1=183472&r2=183473&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Jun 6 20:10:41 2013
@@ -1947,13 +1947,19 @@ llvm::DIType CGDebugInfo::getOrCreateTyp
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) {
More information about the cfe-commits
mailing list