diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCRegisterInfo.h')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCRegisterInfo.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCRegisterInfo.h b/llvm/lib/Target/PowerPC/PPCRegisterInfo.h index a50e05920cd..a5fbb0c6ec6 100644 --- a/llvm/lib/Target/PowerPC/PPCRegisterInfo.h +++ b/llvm/lib/Target/PowerPC/PPCRegisterInfo.h @@ -61,6 +61,15 @@ class PPCRegisterInfo : public PPCGenRegisterInfo { public: PPCRegisterInfo(const PPCTargetMachine &TM); + /// getMappedIdxOpcForImmOpc - Return the mapped index form load/store opcode + /// for a given imm form load/store opcode \p ImmFormOpcode. + /// FIXME: move this to PPCInstrInfo class. + unsigned getMappedIdxOpcForImmOpc(unsigned ImmOpcode) const { + if (!ImmToIdxMap.count(ImmOpcode)) + return PPC::INSTRUCTION_LIST_END; + return ImmToIdxMap.find(ImmOpcode)->second; + } + /// getPointerRegClass - Return the register class to use to hold pointers. /// This is used for addressing modes. const TargetRegisterClass * |

