]> granicus.if.org Git - llvm/commitdiff
[MachineOutliner] NFC: Rename getters/setters to fit coding style
authorJessica Paquette <jpaquette@apple.com>
Mon, 23 Oct 2017 16:25:53 +0000 (16:25 +0000)
committerJessica Paquette <jpaquette@apple.com>
Mon, 23 Oct 2017 16:25:53 +0000 (16:25 +0000)
Rename endIdx, startIdx, and length to getEndIdx, getStartIdx, and getLength
in Candidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316341 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineOutliner.cpp

index 8c268cf32d85f1c29e1cbf161a621ba6a796eb21..cf919a0928c8862ffa0f4b2aaaf570f283042fb7 100644 (file)
@@ -111,13 +111,13 @@ public:
   TargetInstrInfo::MachineOutlinerInfo MInfo;
 
   /// Return the number of instructions in this Candidate.
-  unsigned length() const { return Len; }
+  unsigned getLength() const { return Len; }
 
   /// Return the start index of this candidate.
-  unsigned startIdx() const { return StartIdx; }
+  unsigned getStartIdx() const { return StartIdx; }
 
   // Return the end index of this candidate.
-  unsigned endIdx() const { return StartIdx + Len - 1; }
+  unsigned getEndIdx() const { return StartIdx + Len - 1; }
 
   /// \brief The number of instructions that would be saved by outlining every
   /// candidate of this type.
@@ -136,7 +136,7 @@ public:
   /// \brief Used to ensure that \p Candidates are outlined in an order that
   /// preserves the start and end indices of other \p Candidates.
   bool operator<(const Candidate &RHS) const {
-    return startIdx() > RHS.startIdx();
+    return getStartIdx() > RHS.getStartIdx();
   }
 };
 
@@ -1081,8 +1081,8 @@ void MachineOutliner::pruneOverlaps(std::vector<Candidate> &CandidateList,
     unsigned FarthestPossibleIdx = 0;
 
     // Either the index is 0, or it's at most MaxCandidateLen indices away.
-    if (C1.startIdx() > MaxCandidateLen)
-      FarthestPossibleIdx = C1.startIdx() - MaxCandidateLen;
+    if (C1.getStartIdx() > MaxCandidateLen)
+      FarthestPossibleIdx = C1.getStartIdx() - MaxCandidateLen;
 
     // Compare against the candidates in the list that start at at most
     // FarthestPossibleIdx indices away from C1. There are at most
@@ -1091,7 +1091,7 @@ void MachineOutliner::pruneOverlaps(std::vector<Candidate> &CandidateList,
       Candidate &C2 = *Sit;
 
       // Is this candidate too far away to overlap?
-      if (C2.startIdx() < FarthestPossibleIdx)
+      if (C2.getStartIdx() < FarthestPossibleIdx)
         break;
 
       // If C2 was already pruned, or its function is no longer beneficial for
@@ -1107,7 +1107,7 @@ void MachineOutliner::pruneOverlaps(std::vector<Candidate> &CandidateList,
       // We sorted our candidate list so C2Start <= C1Start. We know that
       // C2End > C2Start since each candidate has length >= 2. Therefore, all we
       // have to check is C2End < C2Start to see if we overlap.
-      if (C2.endIdx() < C1.startIdx())
+      if (C2.getEndIdx() < C1.getStartIdx())
         continue;
 
       // C1 and C2 overlap.
@@ -1225,11 +1225,11 @@ bool MachineOutliner::outline(Module &M,
       continue;
 
     // If not, then outline it.
-    assert(C.startIdx() < Mapper.InstrList.size() &&
+    assert(C.getStartIdx() < Mapper.InstrList.size() &&
            "Candidate out of bounds!");
-    MachineBasicBlock *MBB = (*Mapper.InstrList[C.startIdx()]).getParent();
-    MachineBasicBlock::iterator StartIt = Mapper.InstrList[C.startIdx()];
-    unsigned EndIdx = C.endIdx();
+    MachineBasicBlock *MBB = (*Mapper.InstrList[C.getStartIdx()]).getParent();
+    MachineBasicBlock::iterator StartIt = Mapper.InstrList[C.getStartIdx()];
+    unsigned EndIdx = C.getEndIdx();
 
     assert(EndIdx < Mapper.InstrList.size() && "Candidate out of bounds!");
     MachineBasicBlock::iterator EndIt = Mapper.InstrList[EndIdx];
@@ -1249,7 +1249,7 @@ bool MachineOutliner::outline(Module &M,
 
     // Insert a call to the new function and erase the old sequence.
     TII.insertOutlinedCall(M, *MBB, StartIt, *MF, C.MInfo);
-    StartIt = Mapper.InstrList[C.startIdx()];
+    StartIt = Mapper.InstrList[C.getStartIdx()];
     MBB->erase(StartIt, EndIt);
 
     OutlinedSomething = true;