Skip to content

Commit b15b846

Browse files
committed
[SlotIndexes] Simplify SlotIndex() and isSameInstr(). NFC.
Avoid using lie.getPointer() directly when there are helper methods we can use.
1 parent 1d2b558 commit b15b846

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/include/llvm/CodeGen/SlotIndexes.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ class raw_ostream;
125125

126126
// Construct a new slot index from the given one, and set the slot.
127127
SlotIndex(const SlotIndex &li, Slot s) : lie(li.listEntry(), unsigned(s)) {
128-
assert(lie.getPointer() != nullptr &&
129-
"Attempt to construct index with 0 pointer.");
128+
assert(isValid() && "Attempt to construct index with 0 pointer.");
130129
}
131130

132131
/// Returns true if this is a valid index. Invalid indices do
@@ -178,7 +177,7 @@ class raw_ostream;
178177

179178
/// isSameInstr - Return true if A and B refer to the same instruction.
180179
static bool isSameInstr(SlotIndex A, SlotIndex B) {
181-
return A.lie.getPointer() == B.lie.getPointer();
180+
return A.listEntry() == B.listEntry();
182181
}
183182

184183
/// isEarlierInstr - Return true if A refers to an instruction earlier than

0 commit comments

Comments
 (0)