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