1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Avoid needlessly casting away const qualifiers.

llvm-svn: 46877
This commit is contained in:
Dan Gohman 2008-02-08 03:29:40 +00:00
parent 1f255f2db7
commit d1cc100aef
4 changed files with 8 additions and 8 deletions

View File

@ -84,7 +84,7 @@ namespace {
unsigned Op, unsigned RegOpcodeField,
intptr_t PCAdj = 0);
unsigned getX86RegNum(unsigned RegNo);
unsigned getX86RegNum(unsigned RegNo) const;
bool isX86_64ExtendedReg(const MachineOperand &MO);
unsigned determineREX(const MachineInstr &MI);
@ -210,8 +210,8 @@ void Emitter::emitJumpTableAddress(unsigned JTI, unsigned Reloc,
MCE.emitWordLE(0); // The relocated value will be added to the displacement
}
unsigned Emitter::getX86RegNum(unsigned RegNo) {
return ((X86RegisterInfo&)II->getRegisterInfo()).getX86RegNum(RegNo);
unsigned Emitter::getX86RegNum(unsigned RegNo) const {
return ((const X86RegisterInfo&)II->getRegisterInfo()).getX86RegNum(RegNo);
}
inline static unsigned char ModRMByte(unsigned Mod, unsigned RegOpcode,

View File

@ -4948,9 +4948,9 @@ SDOperand X86TargetLowering::LowerTRAMPOLINE(SDOperand Op,
const unsigned char MOV64ri = TII->getBaseOpcodeFor(X86::MOV64ri);
const unsigned char N86R10 =
((X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R10);
((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R10);
const unsigned char N86R11 =
((X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R11);
((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R11);
const unsigned char REX_WB = 0x40 | 0x08 | 0x01; // REX prefix
@ -5038,7 +5038,7 @@ SDOperand X86TargetLowering::LowerTRAMPOLINE(SDOperand Op,
const unsigned char MOV32ri = TII->getBaseOpcodeFor(X86::MOV32ri);
const unsigned char N86Reg =
((X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg);
((const X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg);
OutChains[0] = DAG.getStore(Root, DAG.getConstant(MOV32ri|N86Reg, MVT::i8),
Trmp, TrmpAddr, 0);

View File

@ -82,7 +82,7 @@ int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
// getX86RegNum - This function maps LLVM register identifiers to their X86
// specific numbering, which is used in various places encoding instructions.
//
unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) {
unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) const {
switch(RegNo) {
case X86::RAX: case X86::EAX: case X86::AX: case X86::AL: return N86::EAX;
case X86::RCX: case X86::ECX: case X86::CX: case X86::CL: return N86::ECX;

View File

@ -71,7 +71,7 @@ public:
/// getX86RegNum - Returns the native X86 register number for the given LLVM
/// register identifier.
unsigned getX86RegNum(unsigned RegNo);
unsigned getX86RegNum(unsigned RegNo) const;
unsigned getStackAlignment() const { return StackAlign; }