We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7198047 commit ac1a217Copy full SHA for ac1a217
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1068,8 +1068,13 @@ void AsmPrinter::EmitFunctionBody() {
1068
(TT.isOSWindows() && TT.isOSBinFormatCOFF()))) {
1069
MCInst Noop;
1070
MF->getSubtarget().getInstrInfo()->getNoop(Noop);
1071
- OutStreamer->AddComment("avoids zero-length function");
1072
- OutStreamer->EmitInstruction(Noop, getSubtargetInfo());
+
+ // Targets can opt-out of emitting the noop here by leaving the opcode
1073
+ // unspecified.
1074
+ if (Noop.getOpcode()) {
1075
+ OutStreamer->AddComment("avoids zero-length function");
1076
+ OutStreamer->EmitInstruction(Noop, getSubtargetInfo());
1077
+ }
1078
}
1079
1080
const Function *F = MF->getFunction();
0 commit comments