[MCA] Fix a warning
authorKazu Hirata <kazu@google.com>
Mon, 20 Sep 2021 16:46:38 +0000 (09:46 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 20 Sep 2021 16:46:38 +0000 (09:46 -0700)
commitf3cfec9c9e6d90505baaef8ff25ed709e347b226
tree65280b815cc4ac20b3091603d92f1aefa1c2e36b
parent93604c9711cd0325cf92b23529b55db161143a29
[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.
llvm/lib/MCA/Stages/InstructionTables.cpp