10 #ifndef LLVM_MC_MCOBJECTWRITER_H
11 #define LLVM_MC_MCOBJECTWRITER_H
15 #include "llvm/Support/DataTypes.h"
25 class MCSymbolRefExpr;
50 : OS(OS), IsLittleEndian(IsLittleEndian) {}
82 bool &IsPCRel, uint64_t &FixedValue) = 0;
164 const char Zeros[16] = {0};
166 for (
unsigned i = 0, e = N / 16; i != e; ++i)
173 unsigned ZeroFillSize = 0) {
181 (ZeroFillSize == 0 || Str.
size() <= ZeroFillSize) &&
182 "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_ostream & getStream()
size_t size() const
size - Get the string size.
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.
void writeBE64(uint64_t Value)
void write32(uint32_t Value)
virtual ~MCObjectWriter()
virtual bool isSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm, const MCSymbol &SymA, const MCFragment &FB, bool InSet, bool IsPCRel) const
virtual void reset()
lifetime management
void write16(uint16_t Value)
PowerPC TLS Dynamic Call Fixup
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 write(void *memory, value_type value)
Write a value to memory with a particular endianness.
Adapter to write values to a stream in a particular byte order.
void writeLE16(uint16_t Value)
pointer data()
Return a pointer to the vector's buffer, even if empty().
bool isLittleEndian() const
void writeBytes(const SmallVectorImpl< char > &ByteVec, unsigned ZeroFillSize=0)
An abstract base class for streams implementations that also support a pwrite operation.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
void writeBytes(StringRef Str, unsigned ZeroFillSize=0)