1 //===-- X86MachineFunctionInfo.cpp - X86 machine function info ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "X86MachineFunctionInfo.h"
11 #include "X86RegisterInfo.h"
12 #include "llvm/Target/TargetSubtargetInfo.h"
16 void X86MachineFunctionInfo::anchor() { }
18 void X86MachineFunctionInfo::setRestoreBasePointer(const MachineFunction *MF) {
19 if (!RestoreBasePointerOffset) {
20 const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>(
21 MF->getSubtarget().getRegisterInfo());
22 unsigned SlotSize = RegInfo->getSlotSize();
23 for (const MCPhysReg *CSR =
24 RegInfo->X86RegisterInfo::getCalleeSavedRegs(MF);
28 if (X86::GR64RegClass.contains(Reg) || X86::GR32RegClass.contains(Reg))
29 RestoreBasePointerOffset -= SlotSize;