LLVM 20.0.0git
MipsWinCOFFObjectWriter.cpp
Go to the documentation of this file.
1//===- MipsWinCOFFObjectWriter.cpp------------------------------*- C++ -*-===//
2//
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
6//
7//===---------------------------------------------------------------------===//
8
12#include "llvm/MC/MCContext.h"
14
15using namespace llvm;
16
17namespace {
18
19class MipsWinCOFFObjectWriter : public MCWinCOFFObjectTargetWriter {
20public:
21 MipsWinCOFFObjectWriter();
22
23 unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
24 const MCFixup &Fixup, bool IsCrossSection,
25 const MCAsmBackend &MAB) const override;
26};
27
28} // end anonymous namespace
29
30MipsWinCOFFObjectWriter::MipsWinCOFFObjectWriter()
32
33unsigned MipsWinCOFFObjectWriter::getRelocType(MCContext &Ctx,
34 const MCValue &Target,
35 const MCFixup &Fixup,
36 bool IsCrossSection,
37 const MCAsmBackend &MAB) const {
38 unsigned FixupKind = Fixup.getKind();
39
40 switch (FixupKind) {
41 case FK_Data_4:
49 default:
50 Ctx.reportError(Fixup.getLoc(), "unsupported relocation type");
52 }
53}
54
55std::unique_ptr<MCObjectTargetWriter> llvm::createMipsWinCOFFObjectWriter() {
56 return std::make_unique<MipsWinCOFFObjectWriter>();
57}
PowerPC TLS Dynamic Call Fixup
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
Context object for machine code objects.
Definition: MCContext.h:83
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:1072
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:71
This represents an "assembler immediate".
Definition: MCValue.h:36
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsCrossSection, const MCAsmBackend &MAB) const =0
Target - Wrapper for Target specific information.
@ IMAGE_REL_MIPS_JMPADDR
Definition: COFF.h:424
@ IMAGE_REL_MIPS_REFHI
Definition: COFF.h:425
@ IMAGE_REL_MIPS_REFLO
Definition: COFF.h:426
@ IMAGE_REL_MIPS_REFWORD
Definition: COFF.h:423
@ IMAGE_FILE_MACHINE_R4000
Definition: COFF.h:112
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::unique_ptr< MCObjectTargetWriter > createMipsWinCOFFObjectWriter()
Construct a Mips Win COFF object writer.
@ FK_Data_4
A four-byte fixup.
Definition: MCFixup.h:25