[llvm-commits] [llvm] r159707 - in /llvm/trunk/lib/DebugInfo: DWARFCompileUnit.cpp DWARFCompileUnit.h

Eric Christopher echristo at apple.com
Wed Jul 4 13:07:45 PDT 2012


On Jul 4, 2012, at 2:42 AM, Alexey Samsonov wrote:

> Author: samsonov
> Date: Wed Jul  4 04:42:54 2012
> New Revision: 159707
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=159707&view=rev
> Log:
> Fix a bug in DebugInfo lib, extend a comment for one of the methods
> 

To echo Bill please don't make any commits like this again. Also if you could
update the comment in the code you fixed to explain what's going on since it
was obviously not obvious what the code should be doing :)

-eric

> Modified:
>    llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp
>    llvm/trunk/lib/DebugInfo/DWARFCompileUnit.h
> 
> Modified: llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp?rev=159707&r1=159706&r2=159707&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp Wed Jul  4 04:42:54 2012
> @@ -239,8 +239,8 @@
> 
> const DWARFDebugInfoEntryMinimal*
> DWARFCompileUnit::getFunctionDIEForAddress(int64_t address) {
> -  size_t n = extractDIEsIfNeeded(false);
> -  for (size_t i = 0; i != n; i++) {
> +  extractDIEsIfNeeded(false);
> +  for (size_t i = 0, n = DieArray.size(); i != n; i++) {
>     if (DieArray[i].addressRangeContainsAddress(this, address))
>       return &DieArray[i];
>   }
> 
> Modified: llvm/trunk/lib/DebugInfo/DWARFCompileUnit.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFCompileUnit.h?rev=159707&r1=159706&r2=159707&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFCompileUnit.h (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFCompileUnit.h Wed Jul  4 04:42:54 2012
> @@ -43,7 +43,7 @@
>                    const DWARFAbbreviationDeclarationSet *abbrevs);
> 
>   /// extractDIEsIfNeeded - Parses a compile unit and indexes its DIEs if it
> -  /// hasn't already been done.
> +  /// hasn't already been done. Returns the number of DIEs parsed at this call.
>   size_t extractDIEsIfNeeded(bool cu_die_only);
>   void clear();
>   void dump(raw_ostream &OS);
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list