[lld] r228968 - [ELF] Insert wrap symbols into a set.

Shankar Easwaran shankare at codeaurora.org
Fri Feb 13 12:10:19 PST 2015


On 2/13/2015 1:55 PM, Chandler Carruth wrote:
> On Fri, Feb 13, 2015 at 11:30 AM, Rui Ueyama <ruiu at google.com> wrote:
>
>> Returning a const reference to a set is not wrong at all, and it involves
>> less moving parts, no?
>> The other reason why I prefer a set over range here is because I don't
>> want to see more uses of range in LLD at this moment. I believe range is
>> designed after N3350, which didn't make it to the standard yet. It doesn't
>> feel great that this generic library lives under LLD. If we really need
>> this one, we should move the file to LLVM support directory. Otherwise, I
>> don't like to build a local rule to use range in LLD. After all other LLVM
>> projects are not using this range.
range is used in many parts of lld, its very convenient. We may want to 
delete range in lld and use the LLVM iterator_range type maybe.
> FWIW, LLVM projects are using ranges pretty heavily now, and we added
> llvm::iterator_range to LLVM's ADT library. So I'm pretty happy with
> increased usage of ranges in LLD.
>
> However ranges != sets.
>
> Honestly, std::set is the wrong data type here no matter what.
Why ? Order is less important for me but is nice to have too, I want the 
data structure to contain only unique values.

 From cppreference, http://www.cplusplus.com/reference/set/set/

Sets are containers that store unique elements following a specific order.

The usage is not wrong et all IMO.

Shankar Easwaran

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list