9#ifndef LLVM_MC_MCASSEMBLER_H
10#define LLVM_MC_MCASSEMBLER_H
37class MCBoundaryAlignFragment;
38class MCCVDefRangeFragment;
39class MCCVInlineLineTableFragment;
40class MCDwarfCallFrameFragment;
41class MCDwarfLineAddrFragment;
42class MCEncodedFragment;
45class MCPseudoProbeAddrFragment;
46class MCRelaxableFragment;
66 bool EmitBuildVersion;
81 std::unique_ptr<MCAsmBackend> Backend;
82 std::unique_ptr<MCCodeEmitter> Emitter;
83 std::unique_ptr<MCObjectWriter> Writer;
85 bool HasLayout =
false;
86 bool RelaxAll =
false;
87 bool SubsectionsViaSymbols =
false;
88 bool IncrementalLinkerCompatible =
false;
95 std::vector<std::vector<std::string>> LinkerOptions;
98 std::vector<std::pair<std::string, size_t>> FileNames;
100 std::string CompilerVersion;
116 unsigned BundleAlignSize = 0;
123 unsigned ELFHeaderEFlags = 0;
173 std::tuple<MCValue, uint64_t, bool>
193 std::unique_ptr<MCCodeEmitter> Emitter,
194 std::unique_ptr<MCObjectWriter> Writer);
240 VersionInfo.EmitBuildVersion =
false;
241 VersionInfo.TypeOrPlatform.Type =
Type;
242 VersionInfo.Major =
Major;
243 VersionInfo.Minor =
Minor;
244 VersionInfo.Update =
Update;
250 VersionInfo.EmitBuildVersion =
true;
251 VersionInfo.TypeOrPlatform.Platform =
Platform;
252 VersionInfo.Major =
Major;
253 VersionInfo.Minor =
Minor;
254 VersionInfo.Update =
Update;
259 return DarwinTargetVariantVersionInfo;
265 DarwinTargetVariantVersionInfo.EmitBuildVersion =
true;
266 DarwinTargetVariantVersionInfo.TypeOrPlatform.Platform =
Platform;
267 DarwinTargetVariantVersionInfo.Major =
Major;
268 DarwinTargetVariantVersionInfo.Minor =
Minor;
269 DarwinTargetVariantVersionInfo.Update =
Update;
270 DarwinTargetVariantVersionInfo.SDKVersion =
SDKVersion;
307 return IncrementalLinkerCompatible;
310 IncrementalLinkerCompatible =
Value;
323 "Expect a power-of-two bundle align size");
324 BundleAlignSize =
Size;
341 return LinkerOptions;
370 FileNames.emplace_back(std::string(FileName), Symbols.size());
374 if (CompilerVersion.empty())
375 CompilerVersion = std::move(CompilerVers);
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.
This file defines the SmallVector class.
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Generic interface to target specific assembler backends.
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
MachO::PlatformType Platform
Used when EmitBuildVersion==true.
const_iterator begin() const
MCContext & getContext() const
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
void ensureValid(MCSection &Sec) const
uint64_t getSectionAddressSize(const MCSection &Sec) const
unsigned getELFHeaderEFlags() const
ELF e_header flags.
MCAssembler & operator=(const MCAssembler &)=delete
void Finish()
Finish - Do final processing and write the object to the output stream.
SmallVector< MCSection *, 0 > SectionListType
unsigned getBundleAlignSize() const
bool isBundlingEnabled() const
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
void setSubsectionsViaSymbols(bool Value)
void writeSectionData(raw_ostream &OS, const MCSection *Section) const
Emit the section contents to OS.
const VersionInfoType & getVersionInfo() const
MachO deployment target version information.
const MCLOHContainer & getLOHContainer() const
MCObjectWriter * getWriterPtr() const
MCObjectWriter & getWriter() const
union llvm::MCAssembler::@328 TypeOrPlatform
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()
MCCodeEmitter * getEmitterPtr() const
uint64_t getFragmentOffset(const MCFragment &F) const
void layoutBundle(MCFragment *Prev, MCFragment *F) const
std::vector< std::vector< std::string > > & getLinkerOptions()
MCAssembler(const MCAssembler &)=delete
const VersionInfoType & getDarwinTargetVariantVersionInfo() const
MCCodeEmitter & getEmitter() 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)
uint64_t computeFragmentSize(const MCFragment &F) const
Compute the effective fragment size.
const MCSymbol * getBaseSymbol(const MCSymbol &Symbol) const
MCAsmBackend * getBackendPtr() const
void setELFHeaderEFlags(unsigned Flags)
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
iterator_range< pointee_iterator< typename SmallVector< const MCSymbol *, 0 >::const_iterator > > symbols() const
MCLOHContainer & getLOHContainer()
uint64_t getSectionFileSize(const MCSection &Sec) const
void setDWARFLinetableParams(MCDwarfLineTableParams P)
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.
void setRelaxAll(bool Value)
void setCompilerVersion(std::string CompilerVers)
StringRef getCompilerVersion()
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.
Generic base class for all target subtargets.
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< pointee_iterator< WrappedIteratorT > > make_pointee_range(RangeT &&Range)
const MCSymbolRefExpr * From
const MCSymbolRefExpr * To
An iterator type that allows iterating over the pointees via some other iterator.