[llvm] 91e7a17 - [NFC][llvm-mca] Fix compiler warning

Peng Guo via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 09:46:57 PST 2021


Author: Peng Guo
Date: 2021-02-04T09:44:36-08:00
New Revision: 91e7a17133324ac4beaf6ed45c170436c2d91c98

URL: https://github.com/llvm/llvm-project/commit/91e7a17133324ac4beaf6ed45c170436c2d91c98
DIFF: https://github.com/llvm/llvm-project/commit/91e7a17133324ac4beaf6ed45c170436c2d91c98.diff

LOG: [NFC][llvm-mca] Fix compiler warning

Fix clang compiler warning from `-Wrange-loop-analysis`.

Reviewed By: andreadb

Differential Revision: https://reviews.llvm.org/D95997

Added: 
    

Modified: 
    llvm/tools/llvm-mca/Views/InstructionInfoView.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-mca/Views/InstructionInfoView.cpp b/llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
index 2248f63fe7e9..52a29ff1f5ff 100644
--- a/llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
+++ b/llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
@@ -93,7 +93,7 @@ void InstructionInfoView::collectData(
     MutableArrayRef<InstructionInfoViewData> IIVD) const {
   const llvm::MCSubtargetInfo &STI = getSubTargetInfo();
   const MCSchedModel &SM = STI.getSchedModel();
-  for (const auto &I : zip(getSource(), IIVD)) {
+  for (const auto I : zip(getSource(), IIVD)) {
     const MCInst &Inst = std::get<0>(I);
     InstructionInfoViewData &IIVDEntry = std::get<1>(I);
     const MCInstrDesc &MCDesc = MCII.get(Inst.getOpcode());


        


More information about the llvm-commits mailing list