diff options
| author | Adrian Prantl <aprantl@apple.com> | 2013-06-07 01:10:41 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2013-06-07 01:10:41 +0000 |
| commit | c4de1ef38c0dcd8e0823d329468419796dacbea0 (patch) | |
| tree | 5f7e7e9409ebf1be6d7a8f13c5cdf6b502399723 | |
| parent | 5f0a2ce542a4bc476c1b274d5166be1356e9e938 (diff) | |
| download | bcm5719-llvm-c4de1ef38c0dcd8e0823d329468419796dacbea0.tar.gz bcm5719-llvm-c4de1ef38c0dcd8e0823d329468419796dacbea0.zip | |
Improve documentation.
llvm-svn: 183473
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f90a609b436..86b5075ac22 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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) { |

