diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 57e6b17e6ae..7f661380787 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -197,7 +197,6 @@ MachineInstr* X86RegisterInfo::foldMemoryOperand(MachineInstr* MI, /// FIXME: This should obviously be autogenerated by tablegen when patterns /// are available! - MachineBasicBlock& MBB = *MI->getParent(); if (i == 0) { switch(MI->getOpcode()) { case X86::XCHG8rr: return MakeMRInst(X86::XCHG8mr ,FrameIndex, MI); diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h index d891aed6a7c..f85794bd4b7 100644 --- a/lib/Target/X86/X86TargetMachine.h +++ b/lib/Target/X86/X86TargetMachine.h @@ -40,7 +40,9 @@ public: virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } virtual TargetJITInfo *getJITInfo() { return &JITInfo; } virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } - virtual X86TargetLowering *getTargetLowering() { return &TLInfo; } + virtual X86TargetLowering *getTargetLowering() const { + return const_cast(&TLInfo); + } virtual const MRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); }