9 #ifndef LLVM_MC_MCASSEMBLER_H 10 #define LLVM_MC_MCASSEMBLER_H 78 std::vector<IndirectSymbolData>::const_iterator;
82 std::vector<DataRegionData>::const_iterator;
89 bool EmitBuildVersion;
104 std::unique_ptr<MCAsmBackend> Backend;
106 std::unique_ptr<MCCodeEmitter> Emitter;
108 std::unique_ptr<MCObjectWriter> Writer;
114 std::vector<IndirectSymbolData> IndirectSymbols;
116 std::vector<DataRegionData> DataRegions;
119 std::vector<std::vector<std::string>> LinkerOptions;
122 std::vector<std::string> FileNames;
138 unsigned BundleAlignSize;
141 bool SubsectionsViaSymbols : 1;
142 bool IncrementalLinkerCompatible : 1;
149 unsigned ELFHeaderEFlags;
174 uint64_t &
Value,
bool &WasForced)
const;
197 bool relaxDwarfCallFrameFragment(
MCAsmLayout &Layout,
206 std::tuple<MCValue, uint64_t, bool>
210 std::vector<std::pair<StringRef, const MCSymbol *>>
Symvers;
219 std::unique_ptr<MCCodeEmitter> Emitter,
220 std::unique_ptr<MCObjectWriter> Writer);
227 uint64_t computeFragmentSize(
const MCAsmLayout &Layout,
238 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;
264 VersionInfo.SDKVersion = SDKVersion;
267 unsigned Minor,
unsigned Update,
269 VersionInfo.EmitBuildVersion =
true;
270 VersionInfo.TypeOrPlatform.Platform = Platform;
271 VersionInfo.Major = Major;
272 VersionInfo.Minor = Minor;
273 VersionInfo.Update = Update;
274 VersionInfo.SDKVersion = SDKVersion;
311 return IncrementalLinkerCompatible;
314 IncrementalLinkerCompatible =
Value;
325 assert((Size == 0 || !(Size & (Size - 1))) &&
326 "Expect a power-of-two bundle align size");
327 BundleAlignSize =
Size;
339 size_t size()
const {
return Sections.size(); }
352 return make_range(symbol_begin(), symbol_end());
365 return IndirectSymbols;
369 return IndirectSymbols.begin();
372 return IndirectSymbols.begin();
376 return IndirectSymbols.end();
379 return IndirectSymbols.end();
389 return LinkerOptions;
403 return DataRegions.begin();
408 return DataRegions.end();
422 return const_cast<MCAssembler *
>(
this)->getLOHContainer();
437 void registerSymbol(
const MCSymbol &
Symbol,
bool *Created =
nullptr);
443 FileNames.push_back(FileName);
449 uint64_t FSize)
const;
465 #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...
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
static bool isThumbFunc(object::symbol_iterator Symbol, const object::ObjectFile &Obj, object::section_iterator Section)
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 RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
const_indirect_symbol_iterator indirect_symbol_begin() const
Represents required padding such that a particular other set of fragments does not cross a particular...
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
static LocationDescriptor layout(BlobAllocator &File, yaml::BinaryRef Data)
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.