[MC] Pass through .code16/32/64 and .syntax unified for COFF
These flags should simply be passed through to the target, which will do
the right thing. Add an MC/X86 test that uses these directives with the
three primary object file formats and shows that they disassemble the
same everywhere.
There is a missing test for .code32 on Windows ARM, since I'm not sure
exactly how to construct one.
Fixes PR43203
llvm-svn: 370805
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp
index 04d5f10..4047045 100644
--- a/llvm/lib/MC/MCWinCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp
@@ -88,7 +88,19 @@
}
void MCWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
- llvm_unreachable("not implemented");
+ // Let the target do whatever target specific stuff it needs to do.
+ getAssembler().getBackend().handleAssemblerFlag(Flag);
+
+ switch (Flag) {
+ // None of these require COFF specific handling.
+ case MCAF_SyntaxUnified:
+ case MCAF_Code16:
+ case MCAF_Code32:
+ case MCAF_Code64:
+ break;
+ case MCAF_SubsectionsViaSymbols:
+ llvm_unreachable("COFF doesn't support .subsections_via_symbols");
+ }
}
void MCWinCOFFStreamer::EmitThumbFunc(MCSymbol *Func) {