[llvm] 13922f3 - Fix warnings as errors that occur on sanitizer-x86_64-linux

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 16:02:43 PST 2020


Author: Daniel Sanders
Date: 2020-01-07T16:02:31-08:00
New Revision: 13922f3e9d0c8a0f2612c5e43c922099bbf74a79

URL: https://github.com/llvm/llvm-project/commit/13922f3e9d0c8a0f2612c5e43c922099bbf74a79
DIFF: https://github.com/llvm/llvm-project/commit/13922f3e9d0c8a0f2612c5e43c922099bbf74a79.diff

LOG: Fix warnings as errors that occur on sanitizer-x86_64-linux

Added: 
    

Modified: 
    llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp b/llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp
index b54a3e071ac0..4884bdadea91 100644
--- a/llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp
+++ b/llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp
@@ -411,7 +411,7 @@ void GIMatchTreeOpcodePartitioner::repartition(
 
     // If the opcode is available to test then any opcode predicates will have
     // been enabled too.
-    for (const auto &PIdx : Leaf.value().TestablePredicates.set_bits()) {
+    for (unsigned PIdx : Leaf.value().TestablePredicates.set_bits()) {
       const auto &P = Leaf.value().getPredicate(PIdx);
       SmallVector<const CodeGenInstruction *, 1> OpcodesForThisPredicate;
       if (const auto *OpcodeP = dyn_cast<const GIMatchDagOpcodePredicate>(P)) {
@@ -662,7 +662,7 @@ void GIMatchTreeVRegDefPartitioner::repartition(
     // If this node has an use -> def edge from this operand then this
     // instruction must be in partition 1 (isVRegDef()).
     bool WantsEdge = false;
-    for (const auto &EIdx : Leaf.value().TraversableEdges.set_bits()) {
+    for (unsigned EIdx : Leaf.value().TraversableEdges.set_bits()) {
       const auto &E = Leaf.value().getEdge(EIdx);
       if (E->getFromMI() != InstrInfo->getInstrNode() ||
           E->getFromMO()->getIdx() != OpIdx || E->isDefToUse())
@@ -725,14 +725,14 @@ void GIMatchTreeVRegDefPartitioner::applyForPartition(
   NewInstrID = SubBuilder.allocInstrID();
 
   GIMatchTreeBuilder::LeafVec &NewLeaves = SubBuilder.getPossibleLeaves();
-  for (const auto &I : zip(NewLeaves, TraversedEdgesByNewLeaves)) {
+  for (const auto I : zip(NewLeaves, TraversedEdgesByNewLeaves)) {
     auto &Leaf = std::get<0>(I);
     auto &TraversedEdgesForLeaf = std::get<1>(I);
     GIMatchTreeInstrInfo *InstrInfo = Leaf.getInstrInfo(InstrID);
     // Skip any leaves that don't care about this instruction.
     if (!InstrInfo)
       continue;
-    for (const auto &EIdx : TraversedEdgesForLeaf.set_bits()) {
+    for (unsigned EIdx : TraversedEdgesForLeaf.set_bits()) {
       const GIMatchDagEdge *E = Leaf.getEdge(EIdx);
       Leaf.declareInstr(E->getToMI(), NewInstrID);
     }


        


More information about the llvm-commits mailing list