9#ifndef LLVM_MC_MCASSEMBLER_H
10#define LLVM_MC_MCASSEMBLER_H
36class MCBoundaryAlignFragment;
37class MCCVDefRangeFragment;
38class MCCVInlineLineTableFragment;
39class MCDwarfCallFrameFragment;
40class MCDwarfLineAddrFragment;
41class MCEncodedFragment;
44class MCPseudoProbeAddrFragment;
45class MCRelaxableFragment;
91 std::vector<IndirectSymbolData>::const_iterator;
95 std::vector<DataRegionData>::const_iterator;
102 bool EmitBuildVersion;
117 std::unique_ptr<MCAsmBackend> Backend;
119 std::unique_ptr<MCCodeEmitter> Emitter;
121 std::unique_ptr<MCObjectWriter> Writer;
127 std::vector<IndirectSymbolData> IndirectSymbols;
129 std::vector<DataRegionData> DataRegions;
132 std::vector<std::vector<std::string>> LinkerOptions;
135 std::vector<std::pair<std::string, size_t>> FileNames;
151 unsigned BundleAlignSize;
154 bool SubsectionsViaSymbols : 1;
155 bool IncrementalLinkerCompatible : 1;
162 unsigned ELFHeaderEFlags;
214 bool relaxDwarfCallFrameFragment(
MCAsmLayout &Layout,
224 std::tuple<MCValue, uint64_t, bool>
244 std::unique_ptr<MCCodeEmitter> Emitter,
245 std::unique_ptr<MCObjectWriter> Writer);
284 VersionInfo.EmitBuildVersion =
false;
285 VersionInfo.TypeOrPlatform.Type =
Type;
286 VersionInfo.Major =
Major;
287 VersionInfo.Minor =
Minor;
288 VersionInfo.Update =
Update;
294 VersionInfo.EmitBuildVersion =
true;
295 VersionInfo.TypeOrPlatform.Platform =
Platform;
296 VersionInfo.Major =
Major;
297 VersionInfo.Minor =
Minor;
298 VersionInfo.Update =
Update;
303 return DarwinTargetVariantVersionInfo;
309 DarwinTargetVariantVersionInfo.EmitBuildVersion =
true;
310 DarwinTargetVariantVersionInfo.TypeOrPlatform.Platform =
Platform;
311 DarwinTargetVariantVersionInfo.Major =
Major;
312 DarwinTargetVariantVersionInfo.Minor =
Minor;
313 DarwinTargetVariantVersionInfo.Update =
Update;
314 DarwinTargetVariantVersionInfo.SDKVersion =
SDKVersion;
351 return IncrementalLinkerCompatible;
354 IncrementalLinkerCompatible =
Value;
366 "Expect a power-of-two bundle align size");
367 BundleAlignSize =
Size;
379 size_t size()
const {
return Sections.size(); }
405 return IndirectSymbols;
409 return IndirectSymbols.begin();
412 return IndirectSymbols.begin();
416 return IndirectSymbols.end();
419 return IndirectSymbols.end();
429 return LinkerOptions;
443 return DataRegions.begin();
448 return DataRegions.end();
483 FileNames.emplace_back(std::string(FileName), Symbols.size());
500 const MCEncodedFragment *
F,
uint64_t FOffset,
dxil DXContainer Global Emitter
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallPtrSet class.
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Generic interface to target specific assembler backends.
Encapsulates the layout of an assembly file at a particular point in time.
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
std::vector< IndirectSymbolData > & getIndirectSymbols()
MachO::PlatformType Platform
Used when EmitBuildVersion==true.
indirect_symbol_iterator indirect_symbol_begin()
const_iterator begin() const
MCContext & getContext() const
unsigned getELFHeaderEFlags() const
ELF e_header flags.
std::vector< IndirectSymbolData >::const_iterator const_indirect_symbol_iterator
MCAssembler & operator=(const MCAssembler &)=delete
void Finish()
Finish - Do final processing and write the object to the output stream.
void writeSectionData(raw_ostream &OS, const MCSection *Section, const MCAsmLayout &Layout) const
Emit the section contents to OS.
std::vector< DataRegionData >::const_iterator const_data_region_iterator
unsigned getBundleAlignSize() const
data_region_iterator data_region_begin()
bool isBundlingEnabled() const
symbol_iterator symbol_begin()
bool getSubsectionsViaSymbols() const
void setBundleAlignSize(unsigned Size)
void setIsThumbFunc(const MCSymbol *Func)
Flag a function symbol as the target of a .thumb_func directive.
bool isIncrementalLinkerCompatible() const
size_t symbol_size() const
void setSubsectionsViaSymbols(bool Value)
const VersionInfoType & getVersionInfo() const
MachO deployment target version information.
void layout(MCAsmLayout &Layout)
const MCLOHContainer & getLOHContainer() const
MCObjectWriter * getWriterPtr() const
MCObjectWriter & getWriter() const
const_data_region_iterator data_region_end() const
std::vector< DataRegionData >::iterator data_region_iterator
MCVersionMinType Type
Used when EmitBuildVersion==false.
VersionTuple SDKVersion
An optional version of the SDK that was used to build the source.
MutableArrayRef< std::pair< std::string, size_t > > getFileNames()
const_indirect_symbol_iterator indirect_symbol_begin() const
uint64_t computeFragmentSize(const MCAsmLayout &Layout, const MCFragment &F) const
Compute the effective fragment size assuming it is laid out at the given SectionAddress and FragmentO...
const_data_region_iterator data_region_begin() const
MCCodeEmitter * getEmitterPtr() const
union llvm::MCAssembler::@307 TypeOrPlatform
std::vector< MCSection * > SectionListType
std::vector< IndirectSymbolData >::iterator indirect_symbol_iterator
std::vector< std::vector< std::string > > & getLinkerOptions()
MCAssembler(const MCAssembler &)=delete
std::vector< DataRegionData > & getDataRegions()
const_indirect_symbol_iterator indirect_symbol_end() const
const VersionInfoType & getDarwinTargetVariantVersionInfo() const
MCCodeEmitter & getEmitter() const
std::vector< const MCSymbol * > SymbolDataListType
size_t indirect_symbol_size() const
const_symbol_iterator symbol_end() const
void setDarwinTargetVariantBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
void addFileName(StringRef FileName)
void setIncrementalLinkerCompatible(bool Value)
bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
const_iterator end() const
{ bool EmitBuildVersion VersionInfoType
MachO specific deployment target version info.
MCAsmBackend & getBackend() const
std::vector< Symver > Symvers
std::vector< CGProfileEntry > CGProfile
bool registerSection(MCSection &Section)
data_region_iterator data_region_end()
const MCSymbol * getAtom(const MCSymbol &S) const
Find the symbol which defines the atom containing the given symbol, or null if there is no such symbo...
MCAsmBackend * getBackendPtr() const
bool isSymbolLinkerVisible(const MCSymbol &SD) const
Check whether a particular symbol is visible to the linker and is required in the symbol table,...
const_symbol_iterator symbol_begin() const
void setELFHeaderEFlags(unsigned Flags)
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
MCLOHContainer & getLOHContainer()
void setDWARFLinetableParams(MCDwarfLineTableParams P)
symbol_iterator symbol_end()
void reset()
Reuse an assembler instance.
bool registerSymbol(const MCSymbol &Symbol)
MCDwarfLineTableParams getDWARFLinetableParams() const
void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F, uint64_t FSize) const
Write the necessary bundle padding to OS.
indirect_symbol_iterator indirect_symbol_end()
void setRelaxAll(bool Value)
size_t data_region_size() const
const_symbol_range symbols() const
Represents required padding such that a particular other set of fragments does not cross a particular...
Fragment representing the .cv_def_range directive.
Fragment representing the binary annotations produced by the .cv_inline_linetable directive.
MCCodeEmitter - Generic instruction encoding interface.
Context object for machine code objects.
Interface implemented by fragments that contain encoded instructions and/or data.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Defines the object file and target independent interfaces used by the assembler backend to write nati...
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Represent a reference to a symbol from inside an expression.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
This represents an "assembler immediate".
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Represents a location in source code.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
uint64_t computeBundlePadding(const MCAssembler &Assembler, const MCEncodedFragment *F, uint64_t FOffset, uint64_t FSize)
Compute the amount of padding required before the fragment F to obey bundling restrictions,...
enum llvm::DataRegionData::KindTy Kind
const MCSymbolRefExpr * From
const MCSymbolRefExpr * To
An iterator type that allows iterating over the pointees via some other iterator.