1 //===-- CSKYAsmBackend.h - CSKY Assembler Backend -------------------------===//
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 #ifndef LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYASMBACKEND_H
10 #define LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYASMBACKEND_H
12 #include "MCTargetDesc/CSKYFixupKinds.h"
13 #include "llvm/MC/MCAsmBackend.h"
14 #include "llvm/MC/MCTargetOptions.h"
18 class CSKYAsmBackend
: public MCAsmBackend
{
21 CSKYAsmBackend(const MCSubtargetInfo
&STI
, const MCTargetOptions
&OP
)
22 : MCAsmBackend(support::little
) {}
24 unsigned int getNumFixupKinds() const override
{
25 return CSKY::NumTargetFixupKinds
;
28 void applyFixup(const MCAssembler
&Asm
, const MCFixup
&Fixup
,
29 const MCValue
&Target
, MutableArrayRef
<char> Data
,
30 uint64_t Value
, bool IsResolved
,
31 const MCSubtargetInfo
*STI
) const override
;
33 const MCFixupKindInfo
&getFixupKindInfo(MCFixupKind Kind
) const override
;
35 bool fixupNeedsRelaxation(const MCFixup
&Fixup
, uint64_t Value
,
36 const MCRelaxableFragment
*DF
,
37 const MCAsmLayout
&Layout
) const override
;
39 void relaxInstruction(MCInst
&Inst
,
40 const MCSubtargetInfo
&STI
) const override
;
42 bool writeNopData(raw_ostream
&OS
, uint64_t Count
) const override
;
44 std::unique_ptr
<MCObjectTargetWriter
>
45 createObjectTargetWriter() const override
;
49 #endif // LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYASMBACKEND_H