summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2014-09-16 20:28:00 +0000
committerOwen Anderson <resistor@mac.com>2014-09-16 20:28:00 +0000
commitbfc80a45a71ebabeb27d00397f42c3bcf510aa99 (patch)
tree910dad89bc3dbce099d4fe8f2d177d7eb6e65542 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent1050b57a0be231d7eb42fb46c9122b1e61015fe6 (diff)
downloadbcm5719-llvm-bfc80a45a71ebabeb27d00397f42c3bcf510aa99.tar.gz
bcm5719-llvm-bfc80a45a71ebabeb27d00397f42c3bcf510aa99.zip
Add back a fallback case for targets that do not or cannot implement getNoopForMachoTarget().
llvm-svn: 217899
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b26d8d6f101..4eb289afc18 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -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();
OpenPOWER on IntegriCloud