forked from OSchip/llvm-project
Remove a call to TargetMachine::getSubtarget from the inline
asm support in the asm printer. If we can get a subtarget from the machine function then we should do so, otherwise we can go ahead and create a default one since we're at the module level. llvm-svn: 229916
This commit is contained in:
parent
4343922dde
commit
457864178f
|
@ -92,7 +92,17 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode,
|
|||
!OutStreamer.isIntegratedAssemblerRequired()) {
|
||||
emitInlineAsmStart();
|
||||
OutStreamer.EmitRawText(Str);
|
||||
emitInlineAsmEnd(TM.getSubtarget<MCSubtargetInfo>(), nullptr);
|
||||
// If we have a machine function then grab the MCSubtarget off of that,
|
||||
// otherwise we're at the module level and want to construct one from
|
||||
// the default CPU and target triple.
|
||||
if (MF) {
|
||||
emitInlineAsmEnd(MF->getSubtarget<MCSubtargetInfo>(), nullptr);
|
||||
} else {
|
||||
std::unique_ptr<MCSubtargetInfo> STI(TM.getTarget().createMCSubtargetInfo(
|
||||
TM.getTargetTriple(), TM.getTargetCPU(),
|
||||
TM.getTargetFeatureString()));
|
||||
emitInlineAsmEnd(*STI, nullptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue