1 //===-- ARMWinCOFFStreamer.cpp - ARM Target WinCOFF Streamer ----*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "ARMMCTargetDesc.h"
10 #include "llvm/MC/MCAsmBackend.h"
11 #include "llvm/MC/MCCodeEmitter.h"
12 #include "llvm/MC/MCObjectWriter.h"
13 #include "llvm/MC/MCWinCOFFStreamer.h"
18 class ARMWinCOFFStreamer
: public MCWinCOFFStreamer
{
20 ARMWinCOFFStreamer(MCContext
&C
, std::unique_ptr
<MCAsmBackend
> AB
,
21 std::unique_ptr
<MCCodeEmitter
> CE
,
22 std::unique_ptr
<MCObjectWriter
> OW
)
23 : MCWinCOFFStreamer(C
, std::move(AB
), std::move(CE
), std::move(OW
)) {}
25 void EmitAssemblerFlag(MCAssemblerFlag Flag
) override
;
26 void EmitThumbFunc(MCSymbol
*Symbol
) override
;
27 void FinishImpl() override
;
30 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag
) {
32 default: llvm_unreachable("not implemented");
33 case MCAF_SyntaxUnified
:
39 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol
*Symbol
) {
40 getAssembler().setIsThumbFunc(Symbol
);
43 void ARMWinCOFFStreamer::FinishImpl() {
46 MCWinCOFFStreamer::FinishImpl();
50 MCStreamer
*llvm::createARMWinCOFFStreamer(
51 MCContext
&Context
, std::unique_ptr
<MCAsmBackend
> &&MAB
,
52 std::unique_ptr
<MCObjectWriter
> &&OW
,
53 std::unique_ptr
<MCCodeEmitter
> &&Emitter
, bool RelaxAll
,
54 bool IncrementalLinkerCompatible
) {
55 auto *S
= new ARMWinCOFFStreamer(Context
, std::move(MAB
), std::move(Emitter
),
57 S
->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible
);