LLVM  14.0.0git
MCXCOFFObjectWriter.h
Go to the documentation of this file.
1 //===-- llvm/MC/MCXCOFFObjectWriter.h - XCOFF Object Writer ---------------===//
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_MCXCOFFOBJECTWRITER_H
10 #define LLVM_MC_MCXCOFFOBJECTWRITER_H
11 
12 #include "llvm/MC/MCObjectWriter.h"
13 
14 namespace llvm {
15 
16 class raw_pwrite_stream;
17 
19 protected:
20  MCXCOFFObjectTargetWriter(bool Is64Bit);
21 
22 public:
23  ~MCXCOFFObjectTargetWriter() override;
24 
25  Triple::ObjectFormatType getFormat() const override { return Triple::XCOFF; }
26  static bool classof(const MCObjectTargetWriter *W) {
27  return W->getFormat() == Triple::XCOFF;
28  }
29  bool is64Bit() const { return Is64Bit; }
30 
31  // Returns relocation info such as type, sign and size.
32  // First element of the pair contains type,
33  // second element contains sign and size.
34  virtual std::pair<uint8_t, uint8_t>
35  getRelocTypeAndSignSize(const MCValue &Target, const MCFixup &Fixup,
36  bool IsPCRel) const = 0;
37 
38 private:
39  bool Is64Bit;
40 };
41 
42 std::unique_ptr<MCObjectWriter>
43 createXCOFFObjectWriter(std::unique_ptr<MCXCOFFObjectTargetWriter> MOTW,
44  raw_pwrite_stream &OS);
45 
46 } // end namespace llvm
47 
48 #endif // LLVM_MC_MCXCOFFOBJECTWRITER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::RISCVFenceField::W
@ W
Definition: RISCVBaseInfo.h:208
llvm::MCXCOFFObjectTargetWriter::getFormat
Triple::ObjectFormatType getFormat() const override
Definition: MCXCOFFObjectWriter.h:25
llvm::Triple::XCOFF
@ XCOFF
Definition: Triple.h:245
llvm::MCXCOFFObjectTargetWriter::classof
static bool classof(const MCObjectTargetWriter *W)
Definition: MCXCOFFObjectWriter.h:26
llvm::createXCOFFObjectWriter
std::unique_ptr< MCObjectWriter > createXCOFFObjectWriter(std::unique_ptr< MCXCOFFObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Definition: XCOFFObjectWriter.cpp:1201
llvm::MCXCOFFObjectTargetWriter::getRelocTypeAndSignSize
virtual std::pair< uint8_t, uint8_t > getRelocTypeAndSignSize(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
llvm::MCObjectTargetWriter
Base class for classes that define behaviour that is specific to both the target and the object forma...
Definition: MCObjectWriter.h:112
llvm::MCXCOFFObjectTargetWriter
Definition: MCXCOFFObjectWriter.h:18
llvm::MCXCOFFObjectTargetWriter::MCXCOFFObjectTargetWriter
MCXCOFFObjectTargetWriter(bool Is64Bit)
Definition: MCXCOFFObjectTargetWriter.cpp:13
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition: Triple.h:237
MCObjectWriter.h
llvm::MCXCOFFObjectTargetWriter::~MCXCOFFObjectTargetWriter
~MCXCOFFObjectTargetWriter() override
llvm::MCXCOFFObjectTargetWriter::is64Bit
bool is64Bit() const
Definition: MCXCOFFObjectWriter.h:29
llvm::MCValue
This represents an "assembler immediate".
Definition: MCValue.h:37
llvm::MCFixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:71