10 #ifndef LLVM_MC_MCASSEMBLER_H 11 #define LLVM_MC_MCASSEMBLER_H 78 std::vector<IndirectSymbolData>::const_iterator;
82 std::vector<DataRegionData>::const_iterator;
89 bool EmitBuildVersion;
102 std::unique_ptr<MCAsmBackend> Backend;
104 std::unique_ptr<MCCodeEmitter> Emitter;
106 std::unique_ptr<MCObjectWriter> Writer;
112 std::vector<IndirectSymbolData> IndirectSymbols;
114 std::vector<DataRegionData> DataRegions;
117 std::vector<std::vector<std::string>> LinkerOptions;
120 std::vector<std::string> FileNames;
136 unsigned BundleAlignSize;
139 bool SubsectionsViaSymbols : 1;
140 bool IncrementalLinkerCompatible : 1;
147 unsigned ELFHeaderEFlags;
172 uint64_t &
Value,
bool &WasForced)
const;
198 bool relaxDwarfCallFrameFragment(
MCAsmLayout &Layout,
207 std::tuple<MCValue, uint64_t, bool>
211 std::vector<std::pair<StringRef, const MCSymbol *>>
Symvers;
220 std::unique_ptr<MCCodeEmitter> Emitter,
221 std::unique_ptr<MCObjectWriter> Writer);
228 uint64_t computeFragmentSize(
const MCAsmLayout &Layout,
239 bool isSymbolLinkerVisible(
const MCSymbol &SD)
const;
259 VersionInfo.EmitBuildVersion =
false;
260 VersionInfo.TypeOrPlatform.Type =
Type;
261 VersionInfo.Major = Major;
262 VersionInfo.Minor = Minor;
263 VersionInfo.Update = Update;
266 unsigned Minor,
unsigned Update) {
267 VersionInfo.EmitBuildVersion =
true;
268 VersionInfo.TypeOrPlatform.Platform = Platform;
269 VersionInfo.Major = Major;
270 VersionInfo.Minor = Minor;
271 VersionInfo.Update = Update;
308 return IncrementalLinkerCompatible;
311 IncrementalLinkerCompatible = Value;
322 assert((Size == 0 || !(Size & (Size - 1))) &&
323 "Expect a power-of-two bundle align size");
324 BundleAlignSize =
Size;
336 size_t size()
const {
return Sections.size(); }
349 return make_range(symbol_begin(), symbol_end());
362 return IndirectSymbols;
366 return IndirectSymbols.begin();
369 return IndirectSymbols.begin();
373 return IndirectSymbols.end();
376 return IndirectSymbols.end();
386 return LinkerOptions;
400 return DataRegions.begin();
405 return DataRegions.end();
419 return const_cast<MCAssembler *
>(
this)->getLOHContainer();
434 void registerSymbol(
const MCSymbol &
Symbol,
bool *Created =
nullptr);
440 FileNames.push_back(FileName);
446 uint64_t FSize)
const;
462 #endif // LLVM_MC_MCASSEMBLER_H void setIsThumbFunc(const MCSymbol *Func)
Flag a function symbol as the target of a .thumb_func directive.
void setELFHeaderEFlags(unsigned Flags)
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Fragment for adding required padding.
Compute iterated dominance frontiers using a linear time algorithm.
MCObjectWriter * getWriterPtr() const
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
const_symbol_iterator symbol_end() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
size_t symbol_size() const
std::vector< IndirectSymbolData > & getIndirectSymbols()
const_data_region_iterator data_region_begin() const
const_iterator end() const
bool isBundlingEnabled() const
Defines the object file and target independent interfaces used by the assembler backend to write nati...
symbol_iterator symbol_begin()
std::vector< DataRegionData >::iterator data_region_iterator
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
unsigned getBundleAlignSize() const
const_indirect_symbol_iterator indirect_symbol_end() const
MCContext & getContext() const
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update)
Interface implemented by fragments that contain encoded instructions and/or data. ...
MCDwarfLineTableParams getDWARFLinetableParams() const
Encapsulates the layout of an assembly file at a particular point in time.
MCCodeEmitter & getEmitter() const
void setRelaxAll(bool Value)
const MCSymbolRefExpr * From
Represent a reference to a symbol from inside an expression.
const MCLOHContainer & getLOHContainer() const
MCObjectWriter & getWriter() const
void setSubsectionsViaSymbols(bool Value)
MCVersionMinType Type
Used when EmitBuildVersion==false.
ArrayRef< std::string > getFileNames()
Context object for machine code objects.
void setDWARFLinetableParams(MCDwarfLineTableParams P)
const_symbol_iterator symbol_begin() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void setBundleAlignSize(unsigned Size)
const MCSymbolRefExpr * To
const VersionInfoType & getVersionInfo() const
MachO deployment target version information.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update)
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
The instances of the Type class are immutable: once they are created, they are never changed...
MCCodeEmitter - Generic instruction encoding interface.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
struct { bool EmitBuildVersion VersionInfoType
MachO specific deployment target version info.
MachO::PlatformType Platform
Used when EmitBuildVersion==true.
std::vector< DataRegionData >::const_iterator const_data_region_iterator
std::vector< IndirectSymbolData >::const_iterator const_indirect_symbol_iterator
data_region_iterator data_region_begin()
unsigned getELFHeaderEFlags() const
ELF e_header flags.
std::vector< const MCSymbol * > SymbolDataListType
Fragment representing the .cv_def_range directive.
size_t data_region_size() const
static bool isThumbFunc(symbol_iterator Symbol, const ObjectFile &Obj, section_iterator Section)
const_indirect_symbol_iterator indirect_symbol_begin() const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
std::vector< std::vector< std::string > > & getLinkerOptions()
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
indirect_symbol_iterator indirect_symbol_begin()
MCAsmBackend * getBackendPtr() const
void setIncrementalLinkerCompatible(bool Value)
MCAsmBackend & getBackend() const
An iterator type that allows iterating over the pointees via some other iterator. ...
bool getSubsectionsViaSymbols() const
size_t indirect_symbol_size() const
MCLOHContainer & getLOHContainer()
void addFileName(StringRef FileName)
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, where FOffset is the fragment's offset in its section and FSize is the fragment's size.
A range adaptor for a pair of iterators.
Target - Wrapper for Target specific information.
const_iterator begin() const
Fragment representing the binary annotations produced by the .cv_inline_linetable directive...
std::vector< CGProfileEntry > CGProfile
const_data_region_iterator data_region_end() const
data_region_iterator data_region_end()
std::vector< IndirectSymbolData >::iterator indirect_symbol_iterator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isIncrementalLinkerCompatible() const
LLVM Value Representation.
Generic interface to target specific assembler backends.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
indirect_symbol_iterator indirect_symbol_end()
This class implements an extremely fast bulk output stream that can only output to a stream...
const_symbol_range symbols() const
StringRef - Represent a constant reference to a string, i.e.
std::vector< DataRegionData > & getDataRegions()
std::vector< MCSection * > SectionListType
std::vector< std::pair< StringRef, const MCSymbol * > > Symvers
MCCodeEmitter * getEmitterPtr() const
symbol_iterator symbol_end()
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.