Go to the documentation of this file.
23 #ifndef LLVM_OBJECT_IRSYMTAB_H
24 #define LLVM_OBJECT_IRSYMTAB_H
41 struct BitcodeFileContents;
42 class StringTableBuilder;
64 template <
typename T>
struct Range {
248 return R.get(Symtab);
260 Modules = range(header().Modules);
261 Comdats = range(header().Comdats);
262 Symbols = range(header().Symbols);
263 Uncommons = range(header().Uncommons);
264 DependentLibraries = range(header().DependentLibraries);
287 std::vector<std::pair<StringRef, llvm::Comdat::SelectionKind>>
289 std::vector<std::pair<StringRef, llvm::Comdat::SelectionKind>> ComdatTable;
290 ComdatTable.reserve(Comdats.
size());
291 for (
auto C : Comdats)
302 std::vector<StringRef> Specifiers;
303 Specifiers.reserve(DependentLibraries.
size());
304 for (
auto S : DependentLibraries) {
305 Specifiers.push_back(str(
S));
340 : SymI(SymI), SymE(SymE), UncI(UncI), R(R) {
355 return {
SymbolRef(Symbols.begin(), Symbols.end(), Uncommons.begin(),
this),
356 SymbolRef(Symbols.end(), Symbols.end(),
nullptr,
this)};
362 *MEnd = Symbols.begin() +
M.End;
363 return {
SymbolRef(MBegin, MEnd, Uncommons.begin() +
M.UncBegin,
this),
380 #endif // LLVM_OBJECT_IRSYMTAB_H
StringRef getIRName() const
Returns the unmangled symbol name, or the empty string if this is not an IR symbol.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
StringRef get(StringRef Strtab) const
The contents of the irsymtab in a bitcode file.
StringRef getCOFFWeakExternalFallback() const
COFF-specific: for weak externals, returns the name of the symbol that is used as a fallback if the w...
StringRef getTargetTriple() const
This is equivalent to an IR comdat.
bool canBeOmittedFromSymbolTable() const
bool isExecutable() const
ArrayRef< T > get(StringRef Symtab) const
SymbolRef(const storage::Symbol *SymI, const storage::Symbol *SymE, const storage::Uncommon *UncI, const Reader *R)
StringRef getSectionName() const
std::vector< std::pair< StringRef, llvm::Comdat::SelectionKind > > getComdatTable() const
Returns a table with all the comdats used by this file.
SmallVector< char, 0 > Strtab
Tagged union holding either a T or a Error.
iterator_range< object::content_iterator< SymbolRef > > symbol_range
StringRef COFFWeakExternFallbackName
VisibilityTypes
An enumeration for the kinds of visibility of global values.
StringRef getName() const
Returns the mangled symbol name.
(vector float) vec_cmpeq(*A, *B) C
GlobalValue::VisibilityTypes getVisibility() const
symbol_range module_symbols(unsigned I) const
Returns a slice of the symbol table for the I'th module in the file.
int getComdatIndex() const
Returns the index into the comdat table (see Reader::getComdatTable()), or -1 if not a comdat member.
bool operator==(const SymbolRef &Other) const
Expected< FileContents > readBitcode(const BitcodeFileContents &BFC)
Reads the contents of a bitcode file, creating its irsymtab if necessary.
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
StringRef getSourceFileName() const
Returns the source file path specified at compile time.
Word UncBegin
The index of the first Uncommon for this Module.
uint64_t getCommonSize() const
Allocate memory in an ever growing pool, as if by bump-pointer.
Str IRName
The unmangled symbol name, or the empty string if this is not an IR symbol.
This class can be used to read a Symtab and Strtab produced by irsymtab::build.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This data structure contains rarely used symbol fields and is optionally referenced by a Symbol.
Str SectionName
Specified section name, if any.
StringRef getCOFFLinkerOpts() const
COFF-specific: returns linker options specified in the input file.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
uint32_t getCommonAlignment() const
std::vector< StringRef > getDependentLibraries() const
Returns dependent library specifiers.
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Describes the range of a particular module's symbols within the symbol table.
A reference to a string in the string table.
This represents a symbol that has been read from a storage::Symbol and possibly a storage::Uncommon.
symbol_range symbols() const
Returns the symbol table for the entire bitcode file.
A reference to a range of objects in the symbol table.
Str COFFWeakExternFallbackName
COFF-specific: the name of the symbol that a weak external resolves to if not defined.
Ephemeral symbols produced by Reader::symbols() and Reader::module_symbols().
Lightweight error class with error context and mandatory checking.
SmallVector< char, 0 > Symtab
Utility for building string tables with deduplicated suffixes.
bool isUnnamedAddr() const
size_t getNumModules() const
bool isFormatSpecific() const
Word ComdatIndex
The index into Header::Comdats, or -1 if not a comdat member.
size_t size() const
size - Get the array size.
A range adaptor for a pair of iterators.
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Str Name
The mangled symbol name.
Reader(StringRef Symtab, StringRef Strtab)
Contains the information needed by linkers for symbol resolution, as well as by the LTO implementatio...
Optional< std::vector< StOtherPiece > > Other
Error build(ArrayRef< Module * > Mods, SmallVector< char, 0 > &Symtab, StringTableBuilder &StrtabBuilder, BumpPtrAllocator &Alloc)
Fills in Symtab and StrtabBuilder with a valid symbol and string table for Mods.