diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-10-25 16:55:52 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-10-25 16:55:52 +0000 |
commit | f50d964bdb0674db3e7f18d06a2d1964e0dbd731 (patch) | |
tree | 2deb35973b98edbdd41cadfef6871e2f6e27dcaa /llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp | |
parent | c1472b509202b168e9a4b4a468eaa4a12769a38d (diff) | |
download | bcm5719-llvm-f50d964bdb0674db3e7f18d06a2d1964e0dbd731.tar.gz bcm5719-llvm-f50d964bdb0674db3e7f18d06a2d1964e0dbd731.zip |
[WebAssembly] Add immediate fields to call_indirect and memory operators.
call_indirect, grow_memory, and current_memory now have immediate
operands in the 0xd binary encoding.
llvm-svn: 285085
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp index 31cef3c5457..fc0a01ca30e 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp @@ -100,8 +100,11 @@ bool WebAssemblyCallIndirectFixup::runOnMachineFunction(MachineFunction &MF) { auto Uses = MI.explicit_uses(); MachineInstr::mop_iterator it = Uses.begin(); const MachineOperand MO = *it; - unsigned num = MI.getOperandNo(it); - MI.RemoveOperand(num); + + // Set up the flags immediate, which currently has no defined flags + // so it's always zero. + it->ChangeToImmediate(0); + MI.addOperand(MF, MO); DEBUG(dbgs() << " After transform: " << MI); |