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

Eric Christopher echristo at gmail.com
Wed Jul 17 16:43:24 PDT 2013


>> +    bool operator!=(DIDescriptor Other) const {
>> +      return !operator==(Other);
>
> FWIW I usually write this as: return !(*this == Other); in case that's
> something you might prefer.
>

Interesting, I did look for similar uses in the compiler. No
particular preference though.

>> +    }
>> +
>>      unsigned getTag() const {
>>        return getUnsignedField(0) & ~LLVMDebugVersionMask;
>>      }
>>
>> Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=186544&r1=186543&r2=186544&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Wed Jul 17 18:25:22 2013
>> @@ -220,7 +220,7 @@ public:
>>          DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
>>          Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
>>      assert(Sub.isSubprogram());
>> -    DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
>> +    DEBUG(dbgs() << "create subprogram mdnode " << *Sub << ": "
>
> Curious - how'd you come across this while doing the other thing?
>

It was being converted to bool and then raw_ostream had too many
candidates for how to print it out.

-eric



More information about the llvm-commits mailing list