LLVM 22.0.0git
MCGOFFObjectWriter.h
Go to the documentation of this file.
1//===- MCGOFFObjectWriter.h - GOFF 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_MCGOFFOBJECTWRITER_H
10#define LLVM_MC_MCGOFFOBJECTWRITER_H
11
13#include "llvm/MC/MCValue.h"
14
15namespace llvm {
16class MCObjectWriter;
17class raw_pwrite_stream;
18
20protected:
22
23public:
24 virtual ~MCGOFFObjectTargetWriter() = default;
25
26 Triple::ObjectFormatType getFormat() const override { return Triple::GOFF; }
27
28 static bool classof(const MCObjectTargetWriter *W) {
29 return W->getFormat() == Triple::GOFF;
30 }
31};
32
34 // The target specific GOFF writer instance.
35 std::unique_ptr<MCGOFFObjectTargetWriter> TargetObjectWriter;
36
37 // The stream used to write the GOFF records.
39
40public:
41 GOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
43 ~GOFFObjectWriter() override;
44
45 // Implementation of the MCObjectWriter interface.
47 MCValue Target, uint64_t &FixedValue) override {}
48
49 uint64_t writeObject() override;
50};
51
52/// \brief Construct a new GOFF writer instance.
53///
54/// \param MOTW - The target-specific GOFF writer subclass.
55/// \param OS - The stream to write to.
56/// \returns The constructed object writer.
57std::unique_ptr<MCObjectWriter>
58createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
59 raw_pwrite_stream &OS);
60} // namespace llvm
61
62#endif
#define F(x, y, z)
Definition: MD5.cpp:55
PowerPC TLS Dynamic Call Fixup
raw_pwrite_stream & OS
uint64_t writeObject() override
Write the object file and returns the number of bytes written.
void recordRelocation(const MCFragment &F, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue) override
Record a relocation entry.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:61
static bool classof(const MCObjectTargetWriter *W)
virtual ~MCGOFFObjectTargetWriter()=default
Triple::ObjectFormatType getFormat() const override
Base class for classes that define behaviour that is specific to both the target and the object forma...
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Target - Wrapper for Target specific information.
ObjectFormatType
Definition: Triple.h:315
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:435
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::unique_ptr< MCObjectWriter > createGOFFObjectWriter(std::unique_ptr< MCGOFFObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new GOFF writer instance.