diff options
author | Reid Kleckner <rnk@google.com> | 2019-09-03 18:16:52 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-09-03 18:16:52 +0000 |
commit | b2d10cf22ed00d4869d565b172a7df5e7f2e0540 (patch) | |
tree | a09badfd2ca98a1e439b7eba23897f3259fbcd0c /llvm/lib/MC/MCWinCOFFStreamer.cpp | |
parent | d6f097eeb883de57050f9ad2302a0468d6b63f4c (diff) | |
download | bcm5719-llvm-b2d10cf22ed00d4869d565b172a7df5e7f2e0540.tar.gz bcm5719-llvm-b2d10cf22ed00d4869d565b172a7df5e7f2e0540.zip |
[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
Diffstat (limited to 'llvm/lib/MC/MCWinCOFFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCWinCOFFStreamer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp index 04d5f100a2f..40470452686 100644 --- a/llvm/lib/MC/MCWinCOFFStreamer.cpp +++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp @@ -88,7 +88,19 @@ void MCWinCOFFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc) { } 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) { |