If there's no instructions being emitted on X86 for a function, emit a
nop. Emit the nop directly for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46398 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 6a1451d..6f0e41a 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -819,12 +819,8 @@
// be associated with. We emit a noop in this situation.
MachineFunction::iterator I = MF.begin();
- if (++I == MF.end()) {
- MachineBasicBlock &MBB = MF.front();
-
- if (MBB.begin() == MBB.end())
- BuildMI(MBB, MBB.end(), TM.getInstrInfo()->get(PPC::NOP));
- }
+ if (++I == MF.end() && MF.front().empty())
+ O << "\tnop\n";
// Print out code for the function.
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();