31 std::unique_ptr<MCObjectWriter>
34 switch (TW->getFormat()) {
43 cast<MCWinCOFFObjectTargetWriter>(std::move(TW)), OS);
52 std::unique_ptr<MCObjectWriter>
68 {
"FK_Data_1", 0, 8, 0},
69 {
"FK_Data_2", 0, 16, 0},
70 {
"FK_Data_4", 0, 32, 0},
71 {
"FK_Data_8", 0, 64, 0},
76 {
"FK_GPRel_1", 0, 8, 0},
77 {
"FK_GPRel_2", 0, 16, 0},
78 {
"FK_GPRel_4", 0, 32, 0},
79 {
"FK_GPRel_8", 0, 64, 0},
80 {
"FK_DTPRel_4", 0, 32, 0},
81 {
"FK_DTPRel_8", 0, 64, 0},
82 {
"FK_TPRel_4", 0, 32, 0},
83 {
"FK_TPRel_8", 0, 64, 0},
84 {
"FK_SecRel_1", 0, 8, 0},
85 {
"FK_SecRel_2", 0, 16, 0},
86 {
"FK_SecRel_4", 0, 32, 0},
87 {
"FK_SecRel_8", 0, 64, 0},
88 {
"FK_Data_Add_1", 0, 8, 0},
89 {
"FK_Data_Add_2", 0, 16, 0},
90 {
"FK_Data_Add_4", 0, 32, 0},
91 {
"FK_Data_Add_8", 0, 64, 0},
92 {
"FK_Data_Sub_1", 0, 8, 0},
93 {
"FK_Data_Sub_2", 0, 16, 0},
94 {
"FK_Data_Sub_4", 0, 32, 0},
95 {
"FK_Data_Sub_8", 0, 64, 0}};
98 return Builtins[
Kind];
104 const bool WasForced)
const {
112 CodePadder->handleBasicBlockStart(OS, Context);
117 CodePadder->handleBasicBlockEnd(Context);
121 CodePadder->handleInstructionBegin(Inst);
125 CodePadder->handleInstructionEnd(Inst);
129 return CodePadder->relaxFragment(PF, Layout);
Fragment for adding required padding.
void handleCodePaddingBasicBlockEnd(const MCCodePaddingContext &Context)
Handles all target related code padding after writing a block to an object file.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
const support::endianness Endian
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const =0
void handleCodePaddingInstructionEnd(const MCInst &Inst)
Handles all target related code padding after writing an instruction to an object file...
virtual bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const =0
Simple predicate for targets where !Resolved implies requiring relaxation.
Target-independent base class incharge of all code padding decisions for a target.
std::unique_ptr< MCObjectWriter > createDwoObjectWriter(raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS) const
Create an MCObjectWriter that writes two object files: a .o file which is linked into the final progr...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Encapsulates the layout of an assembly file at a particular point in time.
virtual bool fixupNeedsRelaxationAdvanced(const MCFixup &Fixup, bool Resolved, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout, const bool WasForced) const
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
Streaming object file generation interface.
std::unique_ptr< MCObjectWriter > createELFObjectWriter(std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
Instances of this class represent a single low-level machine instruction.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
MCFixupKind
Extensible enumeration to represent the type of a fixup.
std::unique_ptr< MCObjectWriter > createWasmObjectWriter(std::unique_ptr< MCWasmObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new Wasm writer instance.
void handleCodePaddingInstructionBegin(const MCInst &Inst)
Handles all target related code padding before writing a new instruction to an object file...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::unique_ptr< MCObjectWriter > createWinCOFFObjectWriter(std::unique_ptr< MCWinCOFFObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new Win COFF writer instance.
PowerPC TLS Dynamic Call Fixup
void handleCodePaddingBasicBlockStart(MCObjectStreamer *OS, const MCCodePaddingContext &Context)
Handles all target related code padding when starting to write a new basic block to an object file...
std::unique_ptr< MCObjectWriter > createELFDwoObjectWriter(std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS, bool IsLittleEndian)
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
std::unique_ptr< MCObjectWriter > createObjectWriter(raw_pwrite_stream &OS) const
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file...
std::unique_ptr< MCObjectWriter > createMachObjectWriter(std::unique_ptr< MCMachObjectTargetWriter > MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new Mach-O writer instance.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
bool relaxFragment(MCPaddingFragment *PF, MCAsmLayout &Layout)
Relaxes a fragment (changes the size of the padding) according to target requirements.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
MCAsmBackend(support::endianness Endian)