diff options
author | Chris Lattner <sabre@nondot.org> | 2006-06-17 00:01:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-06-17 00:01:04 +0000 |
commit | b1d26f66658cff3ceb7d44a72fbc8c8e975532f9 (patch) | |
tree | cc1cffbb0102992d2f5c33dd4715bc05b68580f8 /lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | f06ef2cc16fa6b279f4ed59d89b8f14535b47b24 (diff) | |
download | llvm-b1d26f66658cff3ceb7d44a72fbc8c8e975532f9.tar.gz llvm-b1d26f66658cff3ceb7d44a72fbc8c8e975532f9.tar.bz2 llvm-b1d26f66658cff3ceb7d44a72fbc8c8e975532f9.tar.xz |
Implement the getPointerRegClass method, which is required for the ptr_rc
magic to work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index d71f357990..9390442b4d 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -13,13 +13,23 @@ #include "PPCInstrInfo.h" #include "PPCGenInstrInfo.inc" -#include "PPC.h" +#include "PPCTargetMachine.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include <iostream> using namespace llvm; -PPCInstrInfo::PPCInstrInfo() - : TargetInstrInfo(PPCInsts, sizeof(PPCInsts)/sizeof(PPCInsts[0])) {} +PPCInstrInfo::PPCInstrInfo(PPCTargetMachine &tm) + : TargetInstrInfo(PPCInsts, sizeof(PPCInsts)/sizeof(PPCInsts[0])), TM(tm) {} + +/// getPointerRegClass - Return the register class to use to hold pointers. +/// This is used for addressing modes. +const TargetRegisterClass *PPCInstrInfo::getPointerRegClass() const { + if (TM.getSubtargetImpl()->isPPC64()) + return &PPC::G8RCRegClass; + else + return &PPC::GPRCRegClass; +} + bool PPCInstrInfo::isMoveInstr(const MachineInstr& MI, unsigned& sourceReg, |