10 #ifndef LLVM_MC_MCOBJECTWRITER_H
11 #define LLVM_MC_MCOBJECTWRITER_H
15 #include "llvm/Support/DataTypes.h"
26 class MCSymbolRefExpr;
51 : OS(&OS), IsLittleEndian(IsLittleEndian) {}
88 bool &IsPCRel, uint64_t &FixedValue) = 0;
175 const char Zeros[16] = {0};
177 for (
unsigned i = 0, e = N / 16;
i != e; ++
i)
184 unsigned ZeroFillSize = 0) {
192 (ZeroFillSize == 0 || Str.
size() <= ZeroFillSize) &&
193 "data size greater than fill size, unexpected large write will occur");
virtual bool isWeak(const MCSymbol &Sym) const
True if this symbol (which is a variable) is weak.
void WriteZeros(unsigned N)
raw_pwrite_stream & getStream()
void write64(uint64_t Value)
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual void executePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout)=0
Perform any late binding of symbols (for example, to assign symbol indices for use when generating re...
virtual void writeObject(MCAssembler &Asm, const MCAsmLayout &Layout)=0
Write the object file.
void writeLE64(uint64_t Value)
MCObjectWriter(raw_pwrite_stream &OS, bool IsLittleEndian)
Defines the object file and target independent interfaces used by the assembler backend to write nati...
void write8(uint8_t Value)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
bool isSymbolRefDifferenceFullyResolved(const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B, bool InSet) const
Check whether the difference (A - B) between two symbol references is fully resolved.
Encapsulates the layout of an assembly file at a particular point in time.
void writeBE16(uint16_t Value)
Represent a reference to a symbol from inside an expression.
uint64_t tell() const
tell - Return the current offset with the file.
void writeBE64(uint64_t Value)
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void write32(uint32_t Value)
virtual ~MCObjectWriter()
void write(ArrayRef< value_type > Vals)
virtual bool isSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm, const MCSymbol &A, const MCSymbol &B, bool InSet) const
virtual void reset()
lifetime management
unsigned getInitialOffset()
void setStream(raw_pwrite_stream &NewOS)
void write16(uint16_t Value)
Target - Wrapper for Target specific information.
void writeBE32(uint32_t Value)
void writeLE32(uint32_t Value)
virtual void recordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue)=0
Record a relocation entry.
void writeLE16(uint16_t Value)
pointer data()
Return a pointer to the vector's buffer, even if empty().
bool isLittleEndian() const
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
void writeBytes(const SmallVectorImpl< char > &ByteVec, unsigned ZeroFillSize=0)
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
void writeBytes(StringRef Str, unsigned ZeroFillSize=0)
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")