diff --git a/llvm/lib/CodeGen/SafeStackColoring.cpp b/llvm/lib/CodeGen/SafeStackColoring.cpp index 7d2485b6ee928..9abfbd0757935 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 c22469c481f4c..b58e9e47c07a1 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 a2a735a730131..0d096575ee71e 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; }