[all-commits] [llvm/llvm-project] f3cfec: [MCA] Fix a warning

kazutakahirata via All-commits all-commits at lists.llvm.org
Mon Sep 20 09:46:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3cfec9c9e6d90505baaef8ff25ed709e347b226
      https://github.com/llvm/llvm-project/commit/f3cfec9c9e6d90505baaef8ff25ed709e347b226
  Author: Kazu Hirata <kazu at google.com>
  Date:   2021-09-20 (Mon, 20 Sep 2021)

  Changed paths:
    M llvm/lib/MCA/Stages/InstructionTables.cpp

  Log Message:
  -----------
  [MCA] Fix a warning

This patch fixes the warning

  InstructionTables.cpp:27:56: error: loop variable 'Resource' of type
  'const std::pair<const uint64_t, ResourceUsage> &' (aka 'const
  pair<const unsigned long, llvm::mca::ResourceUsage> &') binds to a
  temporary constructed from type 'const std::pair<unsigned long,
  llvm::mca::ResourceUsage> &' [-Werror,-Wrange-loop-construct]

Note that Resource is declared as:

   SmallVector<std::pair<uint64_t, ResourceUsage>, 4> Resources;

without "const" for uint64_t.




More information about the All-commits mailing list