genericize MCAsmStreamer::EmitCodeAlignment to support other targets
so that it doesn't break them when the code generator starts using it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96966 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 07a9553..66a0a24 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -518,8 +518,9 @@
void MCAsmStreamer::EmitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit) {
- // FIXME: a hack for now to only work for x86 using the 0x90 nop opcode.
- EmitValueToAlignment(ByteAlignment, 0x90, 1, MaxBytesToEmit);
+ // Emit with a text fill value.
+ EmitValueToAlignment(ByteAlignment, MAI.getTextAlignFillValue(),
+ 1, MaxBytesToEmit);
}
void MCAsmStreamer::EmitValueToOffset(const MCExpr *Offset,