Skip to content

Commit a12e747

Browse files
committed
[SlotIndexes] Simplify getInstructionFromIndex. NFCI.
This method should never be called on an invalid index.
1 parent 7ddf6e9 commit a12e747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/CodeGen/SlotIndexes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class raw_ostream;
387387
/// Returns the instruction for the given index, or null if the given
388388
/// index has no instruction associated with it.
389389
MachineInstr* getInstructionFromIndex(SlotIndex index) const {
390-
return index.isValid() ? index.listEntry()->getInstr() : nullptr;
390+
return index.listEntry()->getInstr();
391391
}
392392

393393
/// Returns the next non-null index, if one exists.

0 commit comments

Comments
 (0)