10 #ifndef LLVM_MC_MCASSEMBLER_H 11 #define LLVM_MC_MCASSEMBLER_H 79 std::vector<IndirectSymbolData>::const_iterator;
83 std::vector<DataRegionData>::const_iterator;
90 bool EmitBuildVersion;
105 std::unique_ptr<MCAsmBackend> Backend;
107 std::unique_ptr<MCCodeEmitter> Emitter;
109 std::unique_ptr<MCObjectWriter> Writer;
115 std::vector<IndirectSymbolData> IndirectSymbols;
117 std::vector<DataRegionData> DataRegions;
120 std::vector<std::vector<std::string>> LinkerOptions;
123 std::vector<std::string> FileNames;
139 unsigned BundleAlignSize;
142 bool SubsectionsViaSymbols : 1;
143 bool IncrementalLinkerCompatible : 1;
150 unsigned ELFHeaderEFlags;
175 uint64_t &
Value,
bool &WasForced)
const;
201 bool relaxDwarfCallFrameFragment(
MCAsmLayout &Layout,
210 std::tuple<MCValue, uint64_t, bool>
214 std::vector<std::pair<StringRef, const MCSymbol *>>
Symvers;
223 std::unique_ptr<MCCodeEmitter> Emitter,
224 std::unique_ptr<MCObjectWriter> Writer);
231 uint64_t computeFragmentSize(
const MCAsmLayout &Layout,
242 bool isSymbolLinkerVisible(
const MCSymbol &SD)
const;
263 VersionInfo.EmitBuildVersion =
false;
264 VersionInfo.TypeOrPlatform.Type = Type;
265 VersionInfo.Major = Major;
266 VersionInfo.Minor = Minor;
267 VersionInfo.Update = Update;
268 VersionInfo.SDKVersion = SDKVersion;
271 unsigned Minor,
unsigned Update,
273 VersionInfo.EmitBuildVersion =
true;
274 VersionInfo.TypeOrPlatform.Platform = Platform;
275 VersionInfo.Major = Major;
276 VersionInfo.Minor = Minor;
277 VersionInfo.Update = Update;
278 VersionInfo.SDKVersion = SDKVersion;
315 return IncrementalLinkerCompatible;
318 IncrementalLinkerCompatible = Value;
329 assert((Size == 0 || !(Size & (Size - 1))) &&
330 "Expect a power-of-two bundle align size");
331 BundleAlignSize =
Size;
343 size_t size()
const {
return Sections.size(); }
356 return make_range(symbol_begin(), symbol_end());
369 return IndirectSymbols;
373 return IndirectSymbols.begin();
376 return IndirectSymbols.begin();
380 return IndirectSymbols.end();
383 return IndirectSymbols.end();
393 return LinkerOptions;
407 return DataRegions.begin();
412 return DataRegions.end();
426 return const_cast<MCAssembler *
>(
this)->getLOHContainer();
441 void registerSymbol(
const MCSymbol &
Symbol,
bool *Created =
nullptr);
447 FileNames.push_back(FileName);
453 uint64_t FSize)
const;
469 #endif // LLVM_MC_MCASSEMBLER_H void setIsThumbFunc(const MCSymbol *Func)
Flag a function symbol as the target of a .thumb_func directive.
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
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.
This class represents lattice values for constants.
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
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 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.
VersionTuple SDKVersion
An optional version of the SDK that was used to build the source.
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
Represents a version number in the form major[.minor[.subminor[.build]]].
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.
indirect_symbol_iterator indirect_symbol_end()
Defines the llvm::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
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
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
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.