// emitInlineAsmEnd().
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
- // we only need MCInstrInfo for asm parsing.
- const MCInstrInfo *MII =
- MF ? static_cast<const MCInstrInfo *>(MF->getSubtarget().getInstrInfo())
- : static_cast<const MCInstrInfo *>(TM.getTarget().createMCInstrInfo());
+ // we only need MCInstrInfo for asm parsing. We create one unconditionally
+ // because it's not subtarget dependent.
+ std::unique_ptr<MCInstrInfo> MII(TM.getTarget().createMCInstrInfo());
std::unique_ptr<MCTargetAsmParser> TAP(TM.getTarget().createMCAsmParser(
*STI, *Parser, *MII, TM.Options.MCOptions));
if (!TAP)