Skip to content

Commit

Permalink
[SlotIndexes] Simplify getInstructionFromIndex. NFCI.
Browse files Browse the repository at this point in the history
This method should never be called on an invalid index.
  • Loading branch information
jayfoad committed Oct 11, 2023
1 parent 7ddf6e9 commit a12e747
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/SlotIndexes.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class raw_ostream;
/// Returns the instruction for the given index, or null if the given
/// index has no instruction associated with it.
MachineInstr* getInstructionFromIndex(SlotIndex index) const {
return index.isValid() ? index.listEntry()->getInstr() : nullptr;
return index.listEntry()->getInstr();
}

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

0 comments on commit a12e747

Please sign in to comment.