LLVM  13.0.0git
IRSymtab.h
Go to the documentation of this file.
1 //===- IRSymtab.h - data definitions for IR symbol tables -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains data definitions and a reader and builder for a symbol
10 // table for LLVM IR. Its purpose is to allow linkers and other consumers of
11 // bitcode files to efficiently read the symbol table for symbol resolution
12 // purposes without needing to construct a module in memory.
13 //
14 // As with most object files the symbol table has two parts: the symbol table
15 // itself and a string table which is referenced by the symbol table.
16 //
17 // A symbol table corresponds to a single bitcode file, which may consist of
18 // multiple modules, so symbol tables may likewise contain symbols for multiple
19 // modules.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 #ifndef LLVM_OBJECT_IRSYMTAB_H
24 #define LLVM_OBJECT_IRSYMTAB_H
25 
26 #include "llvm/ADT/ArrayRef.h"
27 #include "llvm/ADT/StringRef.h"
29 #include "llvm/IR/GlobalValue.h"
31 #include "llvm/Support/Allocator.h"
32 #include "llvm/Support/Endian.h"
33 #include "llvm/Support/Error.h"
34 #include <cassert>
35 #include <cstdint>
36 #include <vector>
37 
38 namespace llvm {
39 
40 struct BitcodeFileContents;
41 class StringTableBuilder;
42 
43 namespace irsymtab {
44 
45 namespace storage {
46 
47 // The data structures in this namespace define the low-level serialization
48 // format. Clients that just want to read a symbol table should use the
49 // irsymtab::Reader class.
50 
52 
53 /// A reference to a string in the string table.
54 struct Str {
56 
57  StringRef get(StringRef Strtab) const {
58  return {Strtab.data() + Offset, Size};
59  }
60 };
61 
62 /// A reference to a range of objects in the symbol table.
63 template <typename T> struct Range {
65 
66  ArrayRef<T> get(StringRef Symtab) const {
67  return {reinterpret_cast<const T *>(Symtab.data() + Offset), Size};
68  }
69 };
70 
71 /// Describes the range of a particular module's symbols within the symbol
72 /// table.
73 struct Module {
75 
76  /// The index of the first Uncommon for this Module.
78 };
79 
80 /// This is equivalent to an IR comdat.
81 struct Comdat {
83 };
84 
85 /// Contains the information needed by linkers for symbol resolution, as well as
86 /// by the LTO implementation itself.
87 struct Symbol {
88  /// The mangled symbol name.
90 
91  /// The unmangled symbol name, or the empty string if this is not an IR
92  /// symbol.
94 
95  /// The index into Header::Comdats, or -1 if not a comdat member.
97 
99  enum FlagBits {
100  FB_visibility, // 2 bits
113  };
114 };
115 
116 /// This data structure contains rarely used symbol fields and is optionally
117 /// referenced by a Symbol.
118 struct Uncommon {
120 
121  /// COFF-specific: the name of the symbol that a weak external resolves to
122  /// if not defined.
124 
125  /// Specified section name, if any.
127 };
128 
129 
130 struct Header {
131  /// Version number of the symtab format. This number should be incremented
132  /// when the format changes, but it does not need to be incremented if a
133  /// change to LLVM would cause it to create a different symbol table.
135  enum { kCurrentVersion = 2 };
136 
137  /// The producer's version string (LLVM_VERSION_STRING " " LLVM_REVISION).
138  /// Consumers should rebuild the symbol table from IR if the producer's
139  /// version does not match the consumer's version due to potential differences
140  /// in symbol table format, symbol enumeration order and so on.
142 
147 
149 
150  /// COFF-specific: linker directives.
152 
153  /// Dependent Library Specifiers
155 };
156 
157 } // end namespace storage
158 
159 /// Fills in Symtab and StrtabBuilder with a valid symbol and string table for
160 /// Mods.
162  StringTableBuilder &StrtabBuilder, BumpPtrAllocator &Alloc);
163 
164 /// This represents a symbol that has been read from a storage::Symbol and
165 /// possibly a storage::Uncommon.
166 struct Symbol {
167  // Copied from storage::Symbol.
171 
172  // Copied from storage::Uncommon.
176 
177  /// Returns the mangled symbol name.
178  StringRef getName() const { return Name; }
179 
180  /// Returns the unmangled symbol name, or the empty string if this is not an
181  /// IR symbol.
182  StringRef getIRName() const { return IRName; }
183 
184  /// Returns the index into the comdat table (see Reader::getComdatTable()), or
185  /// -1 if not a comdat member.
186  int getComdatIndex() const { return ComdatIndex; }
187 
189 
192  }
193 
194  bool isUndefined() const { return (Flags >> S::FB_undefined) & 1; }
195  bool isWeak() const { return (Flags >> S::FB_weak) & 1; }
196  bool isCommon() const { return (Flags >> S::FB_common) & 1; }
197  bool isIndirect() const { return (Flags >> S::FB_indirect) & 1; }
198  bool isUsed() const { return (Flags >> S::FB_used) & 1; }
199  bool isTLS() const { return (Flags >> S::FB_tls) & 1; }
200 
202  return (Flags >> S::FB_may_omit) & 1;
203  }
204 
205  bool isGlobal() const { return (Flags >> S::FB_global) & 1; }
206  bool isFormatSpecific() const { return (Flags >> S::FB_format_specific) & 1; }
207  bool isUnnamedAddr() const { return (Flags >> S::FB_unnamed_addr) & 1; }
208  bool isExecutable() const { return (Flags >> S::FB_executable) & 1; }
209 
210  uint64_t getCommonSize() const {
211  assert(isCommon());
212  return CommonSize;
213  }
214 
216  assert(isCommon());
217  return CommonAlign;
218  }
219 
220  /// COFF-specific: for weak externals, returns the name of the symbol that is
221  /// used as a fallback if the weak external remains undefined.
223  assert(isWeak() && isIndirect());
225  }
226 
228 };
229 
230 /// This class can be used to read a Symtab and Strtab produced by
231 /// irsymtab::build.
232 class Reader {
233  StringRef Symtab, Strtab;
234 
238  ArrayRef<storage::Uncommon> Uncommons;
239  ArrayRef<storage::Str> DependentLibraries;
240 
241  StringRef str(storage::Str S) const { return S.get(Strtab); }
242 
243  template <typename T> ArrayRef<T> range(storage::Range<T> R) const {
244  return R.get(Symtab);
245  }
246 
247  const storage::Header &header() const {
248  return *reinterpret_cast<const storage::Header *>(Symtab.data());
249  }
250 
251 public:
252  class SymbolRef;
253 
254  Reader() = default;
255  Reader(StringRef Symtab, StringRef Strtab) : Symtab(Symtab), Strtab(Strtab) {
256  Modules = range(header().Modules);
257  Comdats = range(header().Comdats);
258  Symbols = range(header().Symbols);
259  Uncommons = range(header().Uncommons);
260  DependentLibraries = range(header().DependentLibraries);
261  }
262 
264 
265  /// Returns the symbol table for the entire bitcode file.
266  /// The symbols enumerated by this method are ephemeral, but they can be
267  /// copied into an irsymtab::Symbol object.
268  symbol_range symbols() const;
269 
270  size_t getNumModules() const { return Modules.size(); }
271 
272  /// Returns a slice of the symbol table for the I'th module in the file.
273  /// The symbols enumerated by this method are ephemeral, but they can be
274  /// copied into an irsymtab::Symbol object.
275  symbol_range module_symbols(unsigned I) const;
276 
277  StringRef getTargetTriple() const { return str(header().TargetTriple); }
278 
279  /// Returns the source file path specified at compile time.
280  StringRef getSourceFileName() const { return str(header().SourceFileName); }
281 
282  /// Returns a table with all the comdats used by this file.
283  std::vector<StringRef> getComdatTable() const {
284  std::vector<StringRef> ComdatTable;
285  ComdatTable.reserve(Comdats.size());
286  for (auto C : Comdats)
287  ComdatTable.push_back(str(C.Name));
288  return ComdatTable;
289  }
290 
291  /// COFF-specific: returns linker options specified in the input file.
292  StringRef getCOFFLinkerOpts() const { return str(header().COFFLinkerOpts); }
293 
294  /// Returns dependent library specifiers
295  std::vector<StringRef> getDependentLibraries() const {
296  std::vector<StringRef> Specifiers;
297  Specifiers.reserve(DependentLibraries.size());
298  for (auto S : DependentLibraries) {
299  Specifiers.push_back(str(S));
300  }
301  return Specifiers;
302  }
303 };
304 
305 /// Ephemeral symbols produced by Reader::symbols() and
306 /// Reader::module_symbols().
307 class Reader::SymbolRef : public Symbol {
308  const storage::Symbol *SymI, *SymE;
309  const storage::Uncommon *UncI;
310  const Reader *R;
311 
312  void read() {
313  if (SymI == SymE)
314  return;
315 
316  Name = R->str(SymI->Name);
317  IRName = R->str(SymI->IRName);
318  ComdatIndex = SymI->ComdatIndex;
319  Flags = SymI->Flags;
320 
322  CommonSize = UncI->CommonSize;
323  CommonAlign = UncI->CommonAlign;
325  SectionName = R->str(UncI->SectionName);
326  } else
327  // Reset this field so it can be queried unconditionally for all symbols.
328  SectionName = "";
329  }
330 
331 public:
332  SymbolRef(const storage::Symbol *SymI, const storage::Symbol *SymE,
333  const storage::Uncommon *UncI, const Reader *R)
334  : SymI(SymI), SymE(SymE), UncI(UncI), R(R) {
335  read();
336  }
337 
338  void moveNext() {
339  ++SymI;
341  ++UncI;
342  read();
343  }
344 
345  bool operator==(const SymbolRef &Other) const { return SymI == Other.SymI; }
346 };
347 
349  return {SymbolRef(Symbols.begin(), Symbols.end(), Uncommons.begin(), this),
350  SymbolRef(Symbols.end(), Symbols.end(), nullptr, this)};
351 }
352 
354  const storage::Module &M = Modules[I];
355  const storage::Symbol *MBegin = Symbols.begin() + M.Begin,
356  *MEnd = Symbols.begin() + M.End;
357  return {SymbolRef(MBegin, MEnd, Uncommons.begin() + M.UncBegin, this),
358  SymbolRef(MEnd, MEnd, nullptr, this)};
359 }
360 
361 /// The contents of the irsymtab in a bitcode file. Any underlying data for the
362 /// irsymtab are owned by Symtab and Strtab.
363 struct FileContents {
366 };
367 
368 /// Reads the contents of a bitcode file, creating its irsymtab if necessary.
370 
371 } // end namespace irsymtab
372 } // end namespace llvm
373 
374 #endif // LLVM_OBJECT_IRSYMTAB_H
llvm::irsymtab::storage::Range::Offset
Word Offset
Definition: IRSymtab.h:64
llvm::irsymtab::storage::Symbol::FB_has_uncommon
@ FB_has_uncommon
Definition: IRSymtab.h:101
llvm::irsymtab::storage::Header::Symbols
Range< Symbol > Symbols
Definition: IRSymtab.h:145
llvm::irsymtab::storage::Range::Size
Word Size
Definition: IRSymtab.h:64
llvm::irsymtab::Symbol::getIRName
StringRef getIRName() const
Returns the unmangled symbol name, or the empty string if this is not an IR symbol.
Definition: IRSymtab.h:182
llvm::irsymtab::FileContents::TheReader
Reader TheReader
Definition: IRSymtab.h:365
llvm
Definition: AllocatorList.h:23
M
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
Definition: README.txt:252
llvm::irsymtab::storage::Header::Modules
Range< Module > Modules
Definition: IRSymtab.h:143
llvm::irsymtab::storage::Str::get
StringRef get(StringRef Strtab) const
Definition: IRSymtab.h:57
llvm::support::detail::packed_endian_specific_integral
Definition: Endian.h:206
StringRef.h
llvm::irsymtab::storage::Uncommon::CommonSize
Word CommonSize
Definition: IRSymtab.h:119
llvm::irsymtab::FileContents
The contents of the irsymtab in a bitcode file.
Definition: IRSymtab.h:363
llvm::irsymtab::storage::Uncommon::CommonAlign
Word CommonAlign
Definition: IRSymtab.h:119
llvm::irsymtab::Symbol::getCOFFWeakExternalFallback
StringRef getCOFFWeakExternalFallback() const
COFF-specific: for weak externals, returns the name of the symbol that is used as a fallback if the w...
Definition: IRSymtab.h:222
llvm::SmallVector< char, 0 >
llvm::irsymtab::Reader::getTargetTriple
StringRef getTargetTriple() const
Definition: IRSymtab.h:277
llvm::irsymtab::storage::Str::Offset
Word Offset
Definition: IRSymtab.h:55
llvm::irsymtab::storage::Comdat
This is equivalent to an IR comdat.
Definition: IRSymtab.h:81
llvm::irsymtab::Symbol::CommonSize
uint32_t CommonSize
Definition: IRSymtab.h:173
llvm::irsymtab::storage::Symbol::FB_used
@ FB_used
Definition: IRSymtab.h:106
Allocator.h
llvm::irsymtab::Symbol::canBeOmittedFromSymbolTable
bool canBeOmittedFromSymbolTable() const
Definition: IRSymtab.h:201
Error.h
llvm::irsymtab::Symbol::isExecutable
bool isExecutable() const
Definition: IRSymtab.h:208
llvm::irsymtab::storage::Range::get
ArrayRef< T > get(StringRef Symtab) const
Definition: IRSymtab.h:66
llvm::irsymtab::Reader::SymbolRef::SymbolRef
SymbolRef(const storage::Symbol *SymI, const storage::Symbol *SymE, const storage::Uncommon *UncI, const Reader *R)
Definition: IRSymtab.h:332
llvm::irsymtab::Symbol::getSectionName
StringRef getSectionName() const
Definition: IRSymtab.h:227
llvm::irsymtab::Symbol::IRName
StringRef IRName
Definition: IRSymtab.h:168
llvm::irsymtab::storage::Header::DependentLibraries
Range< Str > DependentLibraries
Dependent Library Specifiers.
Definition: IRSymtab.h:154
llvm::irsymtab::storage::Header::Version
Word Version
Version number of the symtab format.
Definition: IRSymtab.h:134
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::irsymtab::FileContents::Strtab
SmallVector< char, 0 > Strtab
Definition: IRSymtab.h:364
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
SymbolicFile.h
llvm::irsymtab::Reader::SymbolRef::moveNext
void moveNext()
Definition: IRSymtab.h:338
llvm::irsymtab::storage::Symbol::FB_undefined
@ FB_undefined
Definition: IRSymtab.h:102
llvm::irsymtab::Symbol::CommonAlign
uint32_t CommonAlign
Definition: IRSymtab.h:173
llvm::irsymtab::Reader::symbol_range
iterator_range< object::content_iterator< SymbolRef > > symbol_range
Definition: IRSymtab.h:263
llvm::irsymtab::storage::Header::Producer
Str Producer
The producer's version string (LLVM_VERSION_STRING " " LLVM_REVISION).
Definition: IRSymtab.h:141
GlobalValue.h
llvm::irsymtab::Symbol::COFFWeakExternFallbackName
StringRef COFFWeakExternFallbackName
Definition: IRSymtab.h:174
llvm::GlobalValue::VisibilityTypes
VisibilityTypes
An enumeration for the kinds of visibility of global values.
Definition: GlobalValue.h:62
llvm::irsymtab::Symbol::SectionName
StringRef SectionName
Definition: IRSymtab.h:175
llvm::irsymtab::Symbol::getName
StringRef getName() const
Returns the mangled symbol name.
Definition: IRSymtab.h:178
llvm::irsymtab::storage::Symbol::Flags
Word Flags
Definition: IRSymtab.h:98
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::irsymtab::Symbol::getVisibility
GlobalValue::VisibilityTypes getVisibility() const
Definition: IRSymtab.h:190
llvm::irsymtab::Reader::module_symbols
symbol_range module_symbols(unsigned I) const
Returns a slice of the symbol table for the I'th module in the file.
Definition: IRSymtab.h:353
llvm::irsymtab::Symbol::isGlobal
bool isGlobal() const
Definition: IRSymtab.h:205
llvm::irsymtab::storage::Header::TargetTriple
Str TargetTriple
Definition: IRSymtab.h:148
llvm::irsymtab::Symbol::getComdatIndex
int getComdatIndex() const
Returns the index into the comdat table (see Reader::getComdatTable()), or -1 if not a comdat member.
Definition: IRSymtab.h:186
llvm::irsymtab::Reader::SymbolRef::operator==
bool operator==(const SymbolRef &Other) const
Definition: IRSymtab.h:345
llvm::irsymtab::storage::Header
Definition: IRSymtab.h:130
llvm::irsymtab::Symbol::isUsed
bool isUsed() const
Definition: IRSymtab.h:198
llvm::BitcodeFileContents
Definition: BitcodeReader.h:123
llvm::irsymtab::storage::Str::Size
Word Size
Definition: IRSymtab.h:55
llvm::irsymtab::Symbol::Flags
uint32_t Flags
Definition: IRSymtab.h:170
llvm::irsymtab::storage::Header::Comdats
Range< Comdat > Comdats
Definition: IRSymtab.h:144
llvm::irsymtab::readBitcode
Expected< FileContents > readBitcode(const BitcodeFileContents &BFC)
Reads the contents of a bitcode file, creating its irsymtab if necessary.
Definition: IRSymtab.cpp:390
llvm::support::ulittle32_t
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Definition: Endian.h:272
llvm::irsymtab::Symbol::isUndefined
bool isUndefined() const
Definition: IRSymtab.h:194
llvm::irsymtab::storage::Header::SourceFileName
Str SourceFileName
Definition: IRSymtab.h:148
llvm::irsymtab::Reader::getSourceFileName
StringRef getSourceFileName() const
Returns the source file path specified at compile time.
Definition: IRSymtab.h:280
llvm::irsymtab::storage::Symbol::FB_visibility
@ FB_visibility
Definition: IRSymtab.h:100
llvm::irsymtab::storage::Symbol::FB_common
@ FB_common
Definition: IRSymtab.h:104
llvm::irsymtab::storage::Module::UncBegin
Word UncBegin
The index of the first Uncommon for this Module.
Definition: IRSymtab.h:77
llvm::irsymtab::Symbol::Name
StringRef Name
Definition: IRSymtab.h:168
llvm::irsymtab::storage::Header::kCurrentVersion
@ kCurrentVersion
Definition: IRSymtab.h:135
llvm::irsymtab::Symbol::getCommonSize
uint64_t getCommonSize() const
Definition: IRSymtab.h:210
llvm::irsymtab::Symbol::ComdatIndex
int ComdatIndex
Definition: IRSymtab.h:169
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::irsymtab::storage::Symbol::IRName
Str IRName
The unmangled symbol name, or the empty string if this is not an IR symbol.
Definition: IRSymtab.h:93
ArrayRef.h
llvm::irsymtab::Reader
This class can be used to read a Symtab and Strtab produced by irsymtab::build.
Definition: IRSymtab.h:232
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::irsymtab::Symbol::isIndirect
bool isIndirect() const
Definition: IRSymtab.h:197
llvm::irsymtab::Symbol::isWeak
bool isWeak() const
Definition: IRSymtab.h:195
iterator_range.h
llvm::irsymtab::storage::Uncommon
This data structure contains rarely used symbol fields and is optionally referenced by a Symbol.
Definition: IRSymtab.h:118
llvm::irsymtab::storage::Uncommon::SectionName
Str SectionName
Specified section name, if any.
Definition: IRSymtab.h:126
llvm::irsymtab::Reader::getCOFFLinkerOpts
StringRef getCOFFLinkerOpts() const
COFF-specific: returns linker options specified in the input file.
Definition: IRSymtab.h:292
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::irsymtab::Symbol::getCommonAlignment
uint32_t getCommonAlignment() const
Definition: IRSymtab.h:215
llvm::irsymtab::Reader::getDependentLibraries
std::vector< StringRef > getDependentLibraries() const
Returns dependent library specifiers.
Definition: IRSymtab.h:295
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
uint32_t
S
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
Definition: README.txt:210
llvm::irsymtab::storage::Module
Describes the range of a particular module's symbols within the symbol table.
Definition: IRSymtab.h:73
llvm::irsymtab::storage::Str
A reference to a string in the string table.
Definition: IRSymtab.h:54
llvm::irsymtab::Symbol
This represents a symbol that has been read from a storage::Symbol and possibly a storage::Uncommon.
Definition: IRSymtab.h:166
llvm::irsymtab::Reader::symbols
symbol_range symbols() const
Returns the symbol table for the entire bitcode file.
Definition: IRSymtab.h:348
llvm::irsymtab::storage::Range
A reference to a range of objects in the symbol table.
Definition: IRSymtab.h:63
llvm::irsymtab::storage::Uncommon::COFFWeakExternFallbackName
Str COFFWeakExternFallbackName
COFF-specific: the name of the symbol that a weak external resolves to if not defined.
Definition: IRSymtab.h:123
llvm::irsymtab::storage::Symbol::FB_weak
@ FB_weak
Definition: IRSymtab.h:103
llvm::irsymtab::Reader::SymbolRef
Ephemeral symbols produced by Reader::symbols() and Reader::module_symbols().
Definition: IRSymtab.h:307
llvm::SectionName
Definition: DWARFSection.h:21
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::irsymtab::storage::Symbol::FB_may_omit
@ FB_may_omit
Definition: IRSymtab.h:108
llvm::irsymtab::FileContents::Symtab
SmallVector< char, 0 > Symtab
Definition: IRSymtab.h:364
llvm::StringTableBuilder
Utility for building string tables with deduplicated suffixes.
Definition: StringTableBuilder.h:23
llvm::irsymtab::storage::Symbol::FlagBits
FlagBits
Definition: IRSymtab.h:99
llvm::irsymtab::Symbol::isUnnamedAddr
bool isUnnamedAddr() const
Definition: IRSymtab.h:207
llvm::irsymtab::storage::Header::COFFLinkerOpts
Str COFFLinkerOpts
COFF-specific: linker directives.
Definition: IRSymtab.h:151
llvm::irsymtab::Reader::getNumModules
size_t getNumModules() const
Definition: IRSymtab.h:270
llvm::irsymtab::storage::Module::Begin
Word Begin
Definition: IRSymtab.h:74
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::irsymtab::storage::Symbol::FB_indirect
@ FB_indirect
Definition: IRSymtab.h:105
llvm::irsymtab::Reader::getComdatTable
std::vector< StringRef > getComdatTable() const
Returns a table with all the comdats used by this file.
Definition: IRSymtab.h:283
llvm::irsymtab::storage::Symbol::FB_global
@ FB_global
Definition: IRSymtab.h:109
llvm::irsymtab::Symbol::isFormatSpecific
bool isFormatSpecific() const
Definition: IRSymtab.h:206
llvm::irsymtab::storage::Symbol::ComdatIndex
Word ComdatIndex
The index into Header::Comdats, or -1 if not a comdat member.
Definition: IRSymtab.h:96
llvm::irsymtab::storage::Symbol::FB_tls
@ FB_tls
Definition: IRSymtab.h:107
llvm::irsymtab::Symbol::isTLS
bool isTLS() const
Definition: IRSymtab.h:199
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:163
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:152
llvm::irsymtab::storage::Comdat::Name
Str Name
Definition: IRSymtab.h:82
llvm::irsymtab::Reader::Reader
Reader()=default
llvm::irsymtab::storage::Symbol::Name
Str Name
The mangled symbol name.
Definition: IRSymtab.h:89
Endian.h
llvm::irsymtab::Reader::Reader
Reader(StringRef Symtab, StringRef Strtab)
Definition: IRSymtab.h:255
llvm::irsymtab::storage::Module::End
Word End
Definition: IRSymtab.h:74
llvm::irsymtab::storage::Header::Uncommons
Range< Uncommon > Uncommons
Definition: IRSymtab.h:146
llvm::irsymtab::storage::Symbol::FB_executable
@ FB_executable
Definition: IRSymtab.h:112
llvm::irsymtab::storage::Symbol
Contains the information needed by linkers for symbol resolution, as well as by the LTO implementatio...
Definition: IRSymtab.h:87
llvm::irsymtab::storage::Symbol::FB_unnamed_addr
@ FB_unnamed_addr
Definition: IRSymtab.h:111
llvm::irsymtab::Symbol::isCommon
bool isCommon() const
Definition: IRSymtab.h:196
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1167
llvm::irsymtab::storage::Symbol::FB_format_specific
@ FB_format_specific
Definition: IRSymtab.h:110
llvm::irsymtab::build
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.
Definition: IRSymtab.cpp:351