[llvm] 7282da1 - [SafeStack,NFC] Fix naming style

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 23:15:12 PDT 2020


Author: Vitaly Buka
Date: 2020-06-14T23:05:42-07:00
New Revision: 7282da1ea818a7c0ef0731e48d7b1e1294ec5196

URL: https://github.com/llvm/llvm-project/commit/7282da1ea818a7c0ef0731e48d7b1e1294ec5196
DIFF: https://github.com/llvm/llvm-project/commit/7282da1ea818a7c0ef0731e48d7b1e1294ec5196.diff

LOG: [SafeStack,NFC] Fix naming style

Added: 
    

Modified: 
    llvm/lib/CodeGen/SafeStackColoring.cpp
    llvm/lib/CodeGen/SafeStackColoring.h
    llvm/lib/CodeGen/SafeStackLayout.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SafeStackColoring.cpp b/llvm/lib/CodeGen/SafeStackColoring.cpp
index 7d2485b6ee92..9abfbd075793 100644
--- a/llvm/lib/CodeGen/SafeStackColoring.cpp
+++ b/llvm/lib/CodeGen/SafeStackColoring.cpp
@@ -149,9 +149,9 @@ void StackColoring::collectMarkers() {
 }
 
 void StackColoring::calculateLocalLiveness() {
-  bool changed = true;
-  while (changed) {
-    changed = false;
+  bool Changed = true;
+  while (Changed) {
+    Changed = false;
 
     for (const BasicBlock *BB : depth_first(&F)) {
       BlockLifetimeInfo &BlockInfo = BlockLiveness.find(BB)->getSecond();
@@ -179,13 +179,13 @@ void StackColoring::calculateLocalLiveness() {
 
       // Update block LiveIn set, noting whether it has changed.
       if (LocalLiveIn.test(BlockInfo.LiveIn)) {
-        changed = true;
+        Changed = true;
         BlockInfo.LiveIn |= LocalLiveIn;
       }
 
       // Update block LiveOut set, noting whether it has changed.
       if (LocalLiveOut.test(BlockInfo.LiveOut)) {
-        changed = true;
+        Changed = true;
         BlockInfo.LiveOut |= LocalLiveOut;
       }
     }
@@ -228,7 +228,7 @@ void StackColoring::calculateLiveIntervals() {
       } else {
         assert(!Ended.test(AllocaNo));
         if (Started.test(AllocaNo)) {
-          LiveRanges[AllocaNo].AddRange(Start[AllocaNo], InstNo);
+          LiveRanges[AllocaNo].addRange(Start[AllocaNo], InstNo);
           Started.reset(AllocaNo);
         }
         Ended.set(AllocaNo);
@@ -237,7 +237,7 @@ void StackColoring::calculateLiveIntervals() {
 
     for (unsigned AllocaNo = 0; AllocaNo < NumAllocas; ++AllocaNo)
       if (Started.test(AllocaNo))
-        LiveRanges[AllocaNo].AddRange(Start[AllocaNo], BBEnd);
+        LiveRanges[AllocaNo].addRange(Start[AllocaNo], BBEnd);
   }
 }
 

diff  --git a/llvm/lib/CodeGen/SafeStackColoring.h b/llvm/lib/CodeGen/SafeStackColoring.h
index c22469c481f4..b58e9e47c07a 100644
--- a/llvm/lib/CodeGen/SafeStackColoring.h
+++ b/llvm/lib/CodeGen/SafeStackColoring.h
@@ -66,13 +66,13 @@ class StackColoring {
 
   public:
     LiveRange(unsigned Size, bool Set = false) : Bits(Size, Set) {}
-    void AddRange(unsigned Start, unsigned End) { Bits.set(Start, End); }
+    void addRange(unsigned Start, unsigned End) { Bits.set(Start, End); }
 
-    bool Overlaps(const LiveRange &Other) const {
+    bool overlaps(const LiveRange &Other) const {
       return Bits.anyCommon(Other.Bits);
     }
 
-    void Join(const LiveRange &Other) { Bits |= Other.Bits; }
+    void join(const LiveRange &Other) { Bits |= Other.Bits; }
   };
 
 private:
@@ -142,15 +142,15 @@ class StackColoring {
 
 static inline raw_ostream &operator<<(raw_ostream &OS, const BitVector &V) {
   OS << "{";
-  int idx = V.find_first();
-  bool first = true;
-  while (idx >= 0) {
-    if (!first) {
+  int Idx = V.find_first();
+  bool First = true;
+  while (Idx >= 0) {
+    if (!First) {
       OS << ", ";
     }
-    first = false;
-    OS << idx;
-    idx = V.find_next(idx);
+    First = false;
+    OS << Idx;
+    Idx = V.find_next(Idx);
   }
   OS << "}";
   return OS;

diff  --git a/llvm/lib/CodeGen/SafeStackLayout.cpp b/llvm/lib/CodeGen/SafeStackLayout.cpp
index a2a735a73013..0d096575ee71 100644
--- a/llvm/lib/CodeGen/SafeStackLayout.cpp
+++ b/llvm/lib/CodeGen/SafeStackLayout.cpp
@@ -75,7 +75,7 @@ void StackLayout::layoutObject(StackObject &Obj) {
       LLVM_DEBUG(dbgs() << "  Does not intersect, skip.\n");
       continue;
     }
-    if (Obj.Range.Overlaps(R.Range)) {
+    if (Obj.Range.overlaps(R.Range)) {
       // Find the next appropriate location.
       Start = AdjustStackOffset(R.End, Obj.Size, Obj.Alignment);
       End = Start + Obj.Size;
@@ -124,7 +124,7 @@ void StackLayout::layoutObject(StackObject &Obj) {
   // Update live ranges for all affected regions.
   for (StackRegion &R : Regions) {
     if (Start < R.End && End > R.Start)
-      R.Range.Join(Obj.Range);
+      R.Range.join(Obj.Range);
     if (End <= R.End)
       break;
   }


        


More information about the llvm-commits mailing list