forked from OSchip/llvm-project
[MachineOperand] Add ChangeToTargetIndex method. NFC
Differential Revision: https://reviews.llvm.org/D36301 llvm-svn: 310083
This commit is contained in:
parent
39195062c2
commit
8de4bbdaa5
|
@ -602,6 +602,10 @@ public:
|
|||
/// Replace this operand with a frame index.
|
||||
void ChangeToFrameIndex(int Idx);
|
||||
|
||||
/// Replace this operand with a target index.
|
||||
void ChangeToTargetIndex(unsigned Idx, int64_t Offset,
|
||||
unsigned char TargetFlags = 0);
|
||||
|
||||
/// ChangeToRegister - Replace this operand with a new register operand of
|
||||
/// the specified value. If an operand is known to be an register already,
|
||||
/// the setReg method should be used.
|
||||
|
|
|
@ -213,6 +213,19 @@ void MachineOperand::ChangeToFrameIndex(int Idx) {
|
|||
setIndex(Idx);
|
||||
}
|
||||
|
||||
void MachineOperand::ChangeToTargetIndex(unsigned Idx, int64_t Offset,
|
||||
unsigned char TargetFlags) {
|
||||
assert((!isReg() || !isTied()) &&
|
||||
"Cannot change a tied operand into a FrameIndex");
|
||||
|
||||
removeRegFromUses();
|
||||
|
||||
OpKind = MO_TargetIndex;
|
||||
setIndex(Idx);
|
||||
setOffset(Offset);
|
||||
setTargetFlags(TargetFlags);
|
||||
}
|
||||
|
||||
/// ChangeToRegister - Replace this operand with a new register operand of
|
||||
/// the specified value. If an operand is known to be an register already,
|
||||
/// the setReg method should be used.
|
||||
|
|
Loading…
Reference in New Issue