forked from OSchip/llvm-project
Save the MachineFunction in startFunction so that we can use it for
lookups of the subtarget later. llvm-svn: 229996
This commit is contained in:
parent
4369c9b42c
commit
ad1ef04ab1
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue