[llvm] r186544 - Add comparison operators for DIDescriptors to fix c++98 fallout

Eric Christopher echristo at gmail.com
Thu Jul 18 12:15:53 PDT 2013


On Thu, Jul 18, 2013 at 1:37 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:
> On 18.07.2013, at 01:29, Eric Christopher <echristo at gmail.com> wrote:
>
>> Author: echristo
>> Date: Wed Jul 17 18:25:22 2013
>> New Revision: 186544
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=186544&view=rev
>> Log:
>> Add comparison operators for DIDescriptors to fix c++98 fallout
>> of operator bool change.
>>
>> Also convert a variable in DebugIR.
>>
>> Modified:
>>    llvm/trunk/include/llvm/DebugInfo.h
>>    llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
>>
>> Modified: llvm/trunk/include/llvm/DebugInfo.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo.h?rev=186544&r1=186543&r2=186544&view=diff
>> ==============================================================================
>> --- llvm/trunk/include/llvm/DebugInfo.h (original)
>> +++ llvm/trunk/include/llvm/DebugInfo.h Wed Jul 17 18:25:22 2013
>> @@ -109,6 +109,13 @@ namespace llvm {
>>     // implicitly convertable to pointer.
>>     LLVM_EXPLICIT operator bool() const { return DbgNode != 0; }
>>
>> +    bool operator==(DIDescriptor Other) const {
>> +      return DbgNode != Other.DbgNode;
>
> Shouldn't this check if the nodes are equal rather than not equal?
>

Yes. Quite. I'm somewhat disturbed that nothing broke. I'll try to
track down a testcase, but I think this was coming in for gcov and
debugir so I'd have to look there.

-eric



More information about the llvm-commits mailing list