[all-commits] [llvm/llvm-project] 15c1c8: [LLVM][ADT] Convert llvm::hash_code to unsigned ex...

Andrei Golubev via All-commits all-commits at lists.llvm.org
Thu Jan 18 09:17:00 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 15c1c85470a17283bd86fe68a702c74599bdcb5c
      https://github.com/llvm/llvm-project/commit/15c1c85470a17283bd86fe68a702c74599bdcb5c
  Author: Andrei Golubev <andrey.golubev at intel.com>
  Date:   2024-01-19 (Fri, 19 Jan 2024)

  Changed paths:
    M llvm/include/llvm/ADT/Hashing.h

  Log Message:
  -----------
  [LLVM][ADT] Convert llvm::hash_code to unsigned explicitly in DenseMapInfo (#77743)

The getHashValue() signature returns a value of type 'unsigned' while
the hash_code could only be implicitly converted to 'size_t'. Depending
on the C++ implementation, this may or may not be a narrowing
conversion.

On some platform/compiler combination, this becomes a warning. To avoid
the warning (and better highlight the narrowing), do an explicit
conversion instead.

Co-authored-by: Orest Chura <orest.chura at intel.com>




More information about the All-commits mailing list