diff options
| author | Marcello Maggioni <hayarms@gmail.com> | 2017-08-04 18:24:09 +0000 |
|---|---|---|
| committer | Marcello Maggioni <hayarms@gmail.com> | 2017-08-04 18:24:09 +0000 |
| commit | 8de4bbdaa5ef3057da37729692f78944a03e5a08 (patch) | |
| tree | 6f4b98770f1d42ff139fbf0df02ac12c4a8e33b5 /llvm/lib | |
| parent | 39195062c20c5fd7d01678ff87c9c2851644a669 (diff) | |
| download | bcm5719-llvm-8de4bbdaa5ef3057da37729692f78944a03e5a08.tar.gz bcm5719-llvm-8de4bbdaa5ef3057da37729692f78944a03e5a08.zip | |
[MachineOperand] Add ChangeToTargetIndex method. NFC
Differential Revision: https://reviews.llvm.org/D36301
llvm-svn: 310083
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 6fd49e30aae..8bf1eb9e33d 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -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. |

