[PATCH] D16571: Compute the DISubprogram hash key partially (NFC)

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 13:42:15 PST 2016


I usually go with "group according to type", so things like file, line, etc
should be grouped and seem more important than scope, but name is most
important so put that first?

-eric

On Tue, Jan 26, 2016 at 1:38 PM Mehdi Amini <mehdi.amini at apple.com> wrote:

> Sure. What’s the criteria for “regularity”? Is it alphabetically sorting?
> (I kept the original order unless I’m mistaken).
>
>> Mehdi
>
> On Jan 26, 2016, at 1:35 PM, Eric Christopher <echristo at gmail.com> wrote:
>
> I'll let Duncan review this more, but as a quick side note - would you
> mind making the ordering of arguments a little more regular? Name, File,
> Line, Scope or something?
>
> -eric
>
> On Tue, Jan 26, 2016 at 12:43 PM Mehdi AMINI via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> joker.eph updated this revision to Diff 46036.
>> joker.eph added a comment.
>>
>> Applies to other metadata types
>>
>>
>> http://reviews.llvm.org/D16571
>>
>> Files:
>>   lib/IR/LLVMContextImpl.h
>>
>> Index: lib/IR/LLVMContextImpl.h
>> ===================================================================
>> --- lib/IR/LLVMContextImpl.h
>> +++ lib/IR/LLVMContextImpl.h
>> @@ -365,8 +365,7 @@
>>             ExtraData == RHS->getRawExtraData();
>>    }
>>    unsigned getHashValue() const {
>> -    return hash_combine(Tag, Name, File, Line, Scope, BaseType,
>> SizeInBits,
>> -                        AlignInBits, OffsetInBits, Flags, ExtraData);
>> +    return hash_combine(Name, File, Line, Scope, BaseType);
>>    }
>>  };
>>
>> @@ -422,9 +421,7 @@
>>             Identifier == RHS->getRawIdentifier();
>>    }
>>    unsigned getHashValue() const {
>> -    return hash_combine(Tag, Name, File, Line, Scope, BaseType,
>> SizeInBits,
>> -                        AlignInBits, OffsetInBits, Flags, Elements,
>> RuntimeLang,
>> -                        VTableHolder, TemplateParams, Identifier);
>> +    return hash_combine(Name, File, Line, Scope, SizeInBits, Elements);
>>    }
>>  };
>>
>> @@ -519,10 +516,7 @@
>>             Variables == RHS->getRawVariables();
>>    }
>>    unsigned getHashValue() const {
>> -    return hash_combine(Scope, Name, LinkageName, File, Line, Type,
>> -                        IsLocalToUnit, IsDefinition, ScopeLine,
>> ContainingType,
>> -                        Virtuality, VirtualIndex, Flags, IsOptimized,
>> -                        TemplateParams, Declaration, Variables);
>> +    return hash_combine(Scope, File, Type, Line);
>>    }
>>  };
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/62b845f8/attachment.html>


More information about the llvm-commits mailing list