[bolt] Remove redundaunt control-flow statements (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 30 Jul 2022 17:35:49 +0000 (10:35 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 30 Jul 2022 17:35:49 +0000 (10:35 -0700)
Identified with readability-redundant-control-flow.

bolt/include/bolt/Core/BinaryFunction.h
bolt/lib/Core/BinaryFunction.cpp
bolt/lib/Core/BinaryFunctionProfile.cpp
bolt/lib/Passes/MCF.cpp
bolt/lib/Passes/ReorderAlgorithm.cpp
bolt/lib/Profile/DataAggregator.cpp

index 16c0ea3..8865038 100644 (file)
@@ -1652,7 +1652,6 @@ public:
     }
     OffsetToCFI.emplace(Offset, FrameInstructions.size());
     FrameInstructions.emplace_back(std::forward<MCCFIInstruction>(Inst));
-    return;
   }
 
   BinaryBasicBlock::iterator addCFIInstruction(BinaryBasicBlock *BB,
index b571b32..7ee4255 100644 (file)
@@ -2614,7 +2614,6 @@ bool BinaryFunction::replayCFIInstrs(int32_t FromState, int32_t ToState,
       // so we might as well fall-through here.
     }
     NewCFIs.push_back(CurState);
-    continue;
   }
 
   // Replay instructions while avoiding duplicates
index ca9cf50..0d705cd 100644 (file)
@@ -339,8 +339,6 @@ void BinaryFunction::inferFallThroughCounts() {
       }
     }
   }
-
-  return;
 }
 
 void BinaryFunction::clearProfile() {
index e92202a..e7ca31e 100644 (file)
@@ -86,7 +86,6 @@ void updateEdgeWeight<BinaryBasicBlock *>(EdgeWeightMap &EdgeWeights,
                                           const BinaryBasicBlock *B,
                                           double Weight) {
   EdgeWeights[std::make_pair(A, B)] = Weight;
-  return;
 }
 
 template <>
@@ -95,7 +94,6 @@ void updateEdgeWeight<Inverse<BinaryBasicBlock *>>(EdgeWeightMap &EdgeWeights,
                                                    const BinaryBasicBlock *B,
                                                    double Weight) {
   EdgeWeights[std::make_pair(B, A)] = Weight;
-  return;
 }
 
 template <class NodeT>
index 0a69f71..bc0df79 100644 (file)
@@ -250,7 +250,6 @@ void PHGreedyClusterAlgorithm::initQueue(std::vector<EdgeTy> &Queue,
 void PHGreedyClusterAlgorithm::adjustQueue(std::vector<EdgeTy> &Queue,
                                            const BinaryFunction &BF) {
   // Nothing to do.
-  return;
 }
 
 bool PHGreedyClusterAlgorithm::areClustersCompatible(const ClusterTy &Front,
index 885a54f..8e500ca 100644 (file)
@@ -316,8 +316,6 @@ void DataAggregator::processFileBuildID(StringRef FileBuildID) {
   } else {
     outs() << "PERF2BOLT: matched build-id and file name\n";
   }
-
-  return;
 }
 
 bool DataAggregator::checkPerfDataMagic(StringRef FileName) {