Index: llvm/trunk/include/llvm/CodeGen/MachineFunction.h =================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h @@ -439,7 +439,6 @@ /// getSubtarget - Return the subtarget for which this machine code is being /// compiled. const TargetSubtargetInfo &getSubtarget() const { return *STI; } - void setSubtarget(const TargetSubtargetInfo *ST) { STI = ST; } /// getSubtarget - This method returns a pointer to the specified type of /// TargetSubtargetInfo. In debug builds, it verifies that the object being Index: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h =================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h @@ -29,7 +29,7 @@ std::unique_ptr TLOF; // Selected ABI MipsABIInfo ABI; - MipsSubtarget *Subtarget; + const MipsSubtarget *Subtarget; MipsSubtarget DefaultSubtarget; MipsSubtarget NoMips16Subtarget; MipsSubtarget Mips16Subtarget; Index: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp =================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp @@ -204,8 +204,7 @@ void MipsTargetMachine::resetSubtarget(MachineFunction *MF) { LLVM_DEBUG(dbgs() << "resetSubtarget\n"); - Subtarget = const_cast(getSubtargetImpl(MF->getFunction())); - MF->setSubtarget(Subtarget); + Subtarget = &MF->getSubtarget(); } namespace {