Add back a fallback case for targets that do not or cannot implement getNoopForMachoTarget().

llvm-svn: 217899
This commit is contained in:
Owen Anderson 2014-09-16 20:28:00 +00:00
parent 1050b57a0b
commit bfc80a45a7
1 changed files with 5 additions and 1 deletions

View File

@ -802,7 +802,11 @@ void AsmPrinter::EmitFunctionBody() {
MCInst Noop;
TM.getSubtargetImpl()->getInstrInfo()->getNoopForMachoTarget(Noop);
OutStreamer.AddComment("avoids zero-length function");
OutStreamer.EmitInstruction(Noop, getSubtargetInfo());
// Targets can opt-out of emitting the noop here by leaving the opcode
// unspecified.
if (Noop.getOpcode())
OutStreamer.EmitInstruction(Noop, getSubtargetInfo());
}
const Function *F = MF->getFunction();