LLVM
17.0.0git
include
llvm
MC
MCWinCOFFObjectWriter.h
Go to the documentation of this file.
1
//===- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer -*- 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
9
#ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H
10
#define LLVM_MC_MCWINCOFFOBJECTWRITER_H
11
12
#include "
llvm/MC/MCObjectWriter.h
"
13
#include <memory>
14
15
namespace
llvm
{
16
17
class
MCAsmBackend;
18
class
MCContext;
19
class
MCFixup;
20
class
MCValue;
21
class
raw_pwrite_stream;
22
23
class
MCWinCOFFObjectTargetWriter
:
public
MCObjectTargetWriter
{
24
virtual
void
anchor();
25
26
const
unsigned
Machine;
27
28
protected
:
29
MCWinCOFFObjectTargetWriter
(
unsigned
Machine_);
30
31
public
:
32
virtual
~MCWinCOFFObjectTargetWriter
() =
default
;
33
34
Triple::ObjectFormatType
getFormat
()
const override
{
return
Triple::COFF
; }
35
static
bool
classof
(
const
MCObjectTargetWriter
*W) {
36
return
W->getFormat() ==
Triple::COFF
;
37
}
38
39
unsigned
getMachine
()
const
{
return
Machine; }
40
virtual
unsigned
getRelocType
(
MCContext
&Ctx,
const
MCValue
&
Target
,
41
const
MCFixup
&
Fixup
,
bool
IsCrossSection,
42
const
MCAsmBackend
&MAB)
const
= 0;
43
virtual
bool
recordRelocation
(
const
MCFixup
&)
const
{
return
true
; }
44
};
45
46
/// Construct a new Win COFF writer instance.
47
///
48
/// \param MOTW - The target specific WinCOFF writer subclass.
49
/// \param OS - The stream to write to.
50
/// \returns The constructed object writer.
51
std::unique_ptr<MCObjectWriter>
52
createWinCOFFObjectWriter
(std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW,
53
raw_pwrite_stream &
OS
);
54
}
// end namespace llvm
55
56
#endif
// LLVM_MC_MCWINCOFFOBJECTWRITER_H
MCObjectWriter.h
Fixup
PowerPC TLS Dynamic Call Fixup
Definition:
PPCTLSDynamicCall.cpp:215
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:53
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition:
MCAsmBackend.h:41
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:76
llvm::MCFixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition:
MCFixup.h:71
llvm::MCObjectTargetWriter
Base class for classes that define behaviour that is specific to both the target and the object forma...
Definition:
MCObjectWriter.h:125
llvm::MCValue
This represents an "assembler immediate".
Definition:
MCValue.h:36
llvm::MCWinCOFFObjectTargetWriter
Definition:
MCWinCOFFObjectWriter.h:23
llvm::MCWinCOFFObjectTargetWriter::recordRelocation
virtual bool recordRelocation(const MCFixup &) const
Definition:
MCWinCOFFObjectWriter.h:43
llvm::MCWinCOFFObjectTargetWriter::classof
static bool classof(const MCObjectTargetWriter *W)
Definition:
MCWinCOFFObjectWriter.h:35
llvm::MCWinCOFFObjectTargetWriter::~MCWinCOFFObjectTargetWriter
virtual ~MCWinCOFFObjectTargetWriter()=default
llvm::MCWinCOFFObjectTargetWriter::getRelocType
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsCrossSection, const MCAsmBackend &MAB) const =0
llvm::MCWinCOFFObjectTargetWriter::getMachine
unsigned getMachine() const
Definition:
MCWinCOFFObjectWriter.h:39
llvm::MCWinCOFFObjectTargetWriter::getFormat
Triple::ObjectFormatType getFormat() const override
Definition:
MCWinCOFFObjectWriter.h:34
llvm::Target
Target - Wrapper for Target specific information.
Definition:
TargetRegistry.h:149
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition:
Triple.h:280
llvm::Triple::COFF
@ COFF
Definition:
Triple.h:283
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::createWinCOFFObjectWriter
std::unique_ptr< MCObjectWriter > createWinCOFFObjectWriter(std::unique_ptr< MCWinCOFFObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new Win COFF writer instance.
Definition:
WinCOFFObjectWriter.cpp:1173
Generated on Tue Jun 6 2023 14:04:27 for LLVM by
1.9.6