mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Unconditionally create a new MCInstrInfo in the asm printer for
asm parsing since it's not subtarget dependent and we can't depend upon the one hanging off the MachineFunction's subtarget still being around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -149,12 +149,11 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode,
|
|||||||
// emitInlineAsmEnd().
|
// emitInlineAsmEnd().
|
||||||
MCSubtargetInfo STIOrig = *STI;
|
MCSubtargetInfo STIOrig = *STI;
|
||||||
|
|
||||||
// We may create a new MCInstrInfo here since we might be at the module level
|
// We create a new MCInstrInfo here since we might be at the module level
|
||||||
// and not have a MachineFunction to initialize the TargetInstrInfo from and
|
// and not have a MachineFunction to initialize the TargetInstrInfo from and
|
||||||
// we only need MCInstrInfo for asm parsing.
|
// we only need MCInstrInfo for asm parsing. We create one unconditionally
|
||||||
const MCInstrInfo *MII =
|
// because it's not subtarget dependent.
|
||||||
MF ? static_cast<const MCInstrInfo *>(MF->getSubtarget().getInstrInfo())
|
std::unique_ptr<MCInstrInfo> MII(TM.getTarget().createMCInstrInfo());
|
||||||
: static_cast<const MCInstrInfo *>(TM.getTarget().createMCInstrInfo());
|
|
||||||
std::unique_ptr<MCTargetAsmParser> TAP(TM.getTarget().createMCAsmParser(
|
std::unique_ptr<MCTargetAsmParser> TAP(TM.getTarget().createMCAsmParser(
|
||||||
*STI, *Parser, *MII, TM.Options.MCOptions));
|
*STI, *Parser, *MII, TM.Options.MCOptions));
|
||||||
if (!TAP)
|
if (!TAP)
|
||||||
|
Reference in New Issue
Block a user