[SafeStack,NFC] Fix naming style

This commit is contained in:
Vitaly Buka 2020-06-14 19:04:47 -07:00
parent 2f5e535a84
commit 7282da1ea8
3 changed files with 19 additions and 19 deletions

View File

@ -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);
}
}

View File

@ -66,13 +66,13 @@ public:
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 @@ public:
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;

View File

@ -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;
}