2012-02-18 12:03:15 +00:00
|
|
|
//===-- X86MachineFuctionInfo.cpp - X86 machine function info -------------===//
|
|
|
|
//
|
2011-12-20 02:50:00 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2012-02-18 12:03:15 +00:00
|
|
|
//
|
2011-12-20 02:50:00 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "X86MachineFunctionInfo.h"
|
2014-12-04 00:56:38 +00:00
|
|
|
#include "X86RegisterInfo.h"
|
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2011-12-20 02:50:00 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
void X86MachineFunctionInfo::anchor() { }
|
2014-12-04 00:56:38 +00:00
|
|
|
|
|
|
|
void X86MachineFunctionInfo::setRestoreBasePointer(const MachineFunction *MF) {
|
|
|
|
if (!RestoreBasePointerOffset) {
|
|
|
|
const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>(
|
|
|
|
MF->getSubtarget().getRegisterInfo());
|
|
|
|
unsigned SlotSize = RegInfo->getSlotSize();
|
2014-12-04 05:20:33 +00:00
|
|
|
for (const MCPhysReg *CSR =
|
2014-12-04 00:56:38 +00:00
|
|
|
RegInfo->X86RegisterInfo::getCalleeSavedRegs(MF);
|
|
|
|
unsigned Reg = *CSR;
|
|
|
|
++CSR)
|
|
|
|
{
|
|
|
|
if (X86::GR64RegClass.contains(Reg) || X86::GR32RegClass.contains(Reg))
|
|
|
|
RestoreBasePointerOffset -= SlotSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|