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

Alexey Samsonov samsonov at google.com
Thu Jul 5 04:14:03 PDT 2012


On Thu, Jul 5, 2012 at 2:22 AM, Nick Lewycky <nicholas at mxc.ca> wrote:

> Bill Wendling wrote:
>
>> 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<http://llvm.org/viewvc/llvm-project?rev=159707&view=rev>
>>> Log:
>>> Fix a bug in DebugInfo lib,
>>>
>>
>> Please be more descriptive of *what* you're fixing and not the fact that
>> you *are* fixing something.
>>
>> This isn't to single you out, Alexey. But there have been *way* too many
>> of these types of commit messages recently. They are almost as bad as
>> having no commit message at all.
>>
>
> Also, if this is a bug fix, where's the regression test?
>

The bug happens only when function is called for the second time. Currently
the only client of libDebugInfo is llvm-dwarfdump, which can never call it
twice.


>
> Nick
>
>  -bw
>>
>>  extend a comment for one of the methods
>>>
>>> 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<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<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 DWARFAbbreviationDeclarationSe**t *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<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>>>
>>
>> ______________________________**_________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>>
>>
>


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120705/149b978c/attachment.html>


More information about the llvm-commits mailing list