Save the MachineFunction in startFunction so that we can use it for

lookups of the subtarget later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229996 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-02-20 08:01:55 +00:00
parent 7b0c988b90
commit b661ab1cbd
2 changed files with 6 additions and 4 deletions

View File

@ -57,6 +57,7 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
void emitShadowPadding(MCStreamer &OutStreamer, const MCSubtargetInfo &STI);
private:
TargetMachine &TM;
const MachineFunction *MF;
std::unique_ptr<MCCodeEmitter> CodeEmitter;
bool InShadow;

View File

@ -74,10 +74,11 @@ namespace llvm {
X86AsmPrinter::StackMapShadowTracker::~StackMapShadowTracker() {}
void
X86AsmPrinter::StackMapShadowTracker::startFunction(MachineFunction &MF) {
X86AsmPrinter::StackMapShadowTracker::startFunction(MachineFunction &F) {
MF = &F;
CodeEmitter.reset(TM.getTarget().createMCCodeEmitter(
*MF.getSubtarget().getInstrInfo(), *MF.getSubtarget().getRegisterInfo(),
MF.getSubtarget(), MF.getContext()));
*MF->getSubtarget().getInstrInfo(), *MF->getSubtarget().getRegisterInfo(),
MF->getSubtarget(), MF->getContext()));
}
void X86AsmPrinter::StackMapShadowTracker::count(MCInst &Inst,
@ -99,7 +100,7 @@ namespace llvm {
if (InShadow && CurrentShadowSize < RequiredShadowSize) {
InShadow = false;
EmitNops(OutStreamer, RequiredShadowSize - CurrentShadowSize,
TM.getSubtarget<X86Subtarget>().is64Bit(), STI);
MF->getSubtarget<X86Subtarget>().is64Bit(), STI);
}
}