Skip to content

Commit f3cfec9

Browse files
[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.
1 parent 93604c9 commit f3cfec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/MCA/Stages/InstructionTables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Error InstructionTables::execute(InstRef &IR) {
2424
UsedResources.clear();
2525

2626
// Identify the resources consumed by this instruction.
27-
for (const std::pair<const uint64_t, ResourceUsage> &Resource :
27+
for (const std::pair<uint64_t, ResourceUsage> &Resource :
2828
Desc.Resources) {
2929
// Skip zero-cycle resources (i.e., unused resources).
3030
if (!Resource.second.size())

0 commit comments

Comments
 (0)