[cfe-dev] DenseMapInfo pass by reference

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 15 09:18:08 PST 2019


Probably copy pasting from other DenseMapInfo over larger types?

On Thu, Feb 14, 2019 at 9:43 AM Loïc Joly via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello,
>
> Today, I discovered that all specializations of DenseMapInfo pass by
> const reference where I would have used pass by value. For instance:
>
> template<> struct DenseMapInfo<char> {
>    static inline char getEmptyKey() { return ~0; }
>    static inline char getTombstoneKey() { return ~0 - 1; }
>    static unsigned getHashValue(const char& Val) { return Val * 37U; }
>    static bool isEqual(const char &LHS, const char &RHS) {
>      return LHS == RHS;
>    }
> };
>
> Do you know why?
>
> ---
>
> Loïc Joly
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190215/1d5a0ac3/attachment.html>


More information about the cfe-dev mailing list