Skip to content

Commit

Permalink
[SafeStack,NFC] Fix naming style
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Jun 15, 2020
1 parent 2f5e535 commit 7282da1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions llvm/lib/CodeGen/SafeStackColoring.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
20 changes: 10 additions & 10 deletions llvm/lib/CodeGen/SafeStackColoring.h
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SafeStackLayout.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 7282da1

Please sign in to comment.