LLVM  8.0.1
LTO.h
Go to the documentation of this file.
1 //===-LTO.h - LLVM Link Time Optimizer ------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares functions and classes used to support LTO. It is intended
11 // to be used both by LTO classes as well as by clients (gold-plugin) that
12 // don't utilize the LTO code generator interfaces.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LTO_LTO_H
17 #define LLVM_LTO_LTO_H
18 
19 #include "llvm/ADT/MapVector.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/ADT/StringSet.h"
22 #include "llvm/IR/DiagnosticInfo.h"
24 #include "llvm/LTO/Config.h"
25 #include "llvm/Linker/IRMover.h"
26 #include "llvm/Object/IRSymtab.h"
27 #include "llvm/Support/Error.h"
29 #include "llvm/Support/thread.h"
32 
33 namespace llvm {
34 
35 class BitcodeModule;
36 class Error;
37 class LLVMContext;
38 class MemoryBufferRef;
39 class Module;
40 class Target;
41 class raw_pwrite_stream;
42 
43 /// Resolve linkage for prevailing symbols in the \p Index. Linkage changes
44 /// recorded in the index and the ThinLTO backends must apply the changes to
45 /// the module via thinLTOResolvePrevailingInModule.
46 ///
47 /// This is done for correctness (if value exported, ensure we always
48 /// emit a copy), and compile-time optimization (allow drop of duplicates).
50  ModuleSummaryIndex &Index,
51  function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
52  isPrevailing,
53  function_ref<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
54  recordNewLinkage);
55 
56 /// Update the linkages in the given \p Index to mark exported values
57 /// as external and non-exported values as internal. The ThinLTO backends
58 /// must apply the changes to the Module via thinLTOInternalizeModule.
60  ModuleSummaryIndex &Index,
61  function_ref<bool(StringRef, GlobalValue::GUID)> isExported);
62 
63 /// Computes a unique hash for the Module considering the current list of
64 /// export/import and other global analysis results.
65 /// The hash is produced in \p Key.
67  SmallString<40> &Key, const lto::Config &Conf,
68  const ModuleSummaryIndex &Index, StringRef ModuleID,
69  const FunctionImporter::ImportMapTy &ImportList,
70  const FunctionImporter::ExportSetTy &ExportList,
71  const std::map<GlobalValue::GUID, GlobalValue::LinkageTypes> &ResolvedODR,
72  const GVSummaryMapTy &DefinedGlobals,
73  const std::set<GlobalValue::GUID> &CfiFunctionDefs = {},
74  const std::set<GlobalValue::GUID> &CfiFunctionDecls = {});
75 
76 namespace lto {
77 
78 /// Given the original \p Path to an output file, replace any path
79 /// prefix matching \p OldPrefix with \p NewPrefix. Also, create the
80 /// resulting directory if it does not yet exist.
81 std::string getThinLTOOutputFile(const std::string &Path,
82  const std::string &OldPrefix,
83  const std::string &NewPrefix);
84 
85 /// Setup optimization remarks.
86 Expected<std::unique_ptr<ToolOutputFile>>
88  bool LTOPassRemarksWithHotness, int Count = -1);
89 
90 class LTO;
91 struct SymbolResolution;
92 class ThinBackendProc;
93 
94 /// An input file. This is a symbol table wrapper that only exposes the
95 /// information that an LTO client should need in order to do symbol resolution.
96 class InputFile {
97 public:
98  class Symbol;
99 
100 private:
101  // FIXME: Remove LTO class friendship once we have bitcode symbol tables.
102  friend LTO;
103  InputFile() = default;
104 
105  std::vector<BitcodeModule> Mods;
106  SmallVector<char, 0> Strtab;
107  std::vector<Symbol> Symbols;
108 
109  // [begin, end) for each module
110  std::vector<std::pair<size_t, size_t>> ModuleSymIndices;
111 
112  StringRef TargetTriple, SourceFileName, COFFLinkerOpts;
113  std::vector<StringRef> ComdatTable;
114 
115 public:
116  ~InputFile();
117 
118  /// Create an InputFile.
120 
121  /// The purpose of this class is to only expose the symbol information that an
122  /// LTO client should need in order to do symbol resolution.
124  friend LTO;
125 
126  public:
127  Symbol(const irsymtab::Symbol &S) : irsymtab::Symbol(S) {}
128 
143  };
144 
145  /// A range over the symbols in this InputFile.
146  ArrayRef<Symbol> symbols() const { return Symbols; }
147 
148  /// Returns linker options specified in the input file.
149  StringRef getCOFFLinkerOpts() const { return COFFLinkerOpts; }
150 
151  /// Returns the path to the InputFile.
152  StringRef getName() const;
153 
154  /// Returns the input file's target triple.
155  StringRef getTargetTriple() const { return TargetTriple; }
156 
157  /// Returns the source file path specified at compile time.
158  StringRef getSourceFileName() const { return SourceFileName; }
159 
160  // Returns a table with all the comdats used by this file.
161  ArrayRef<StringRef> getComdatTable() const { return ComdatTable; }
162 
163 private:
164  ArrayRef<Symbol> module_symbols(unsigned I) const {
165  const auto &Indices = ModuleSymIndices[I];
166  return {Symbols.data() + Indices.first, Symbols.data() + Indices.second};
167  }
168 };
169 
170 /// This class wraps an output stream for a native object. Most clients should
171 /// just be able to return an instance of this base class from the stream
172 /// callback, but if a client needs to perform some action after the stream is
173 /// written to, that can be done by deriving from this class and overriding the
174 /// destructor.
176 public:
177  NativeObjectStream(std::unique_ptr<raw_pwrite_stream> OS) : OS(std::move(OS)) {}
178  std::unique_ptr<raw_pwrite_stream> OS;
179  virtual ~NativeObjectStream() = default;
180 };
181 
182 /// This type defines the callback to add a native object that is generated on
183 /// the fly.
184 ///
185 /// Stream callbacks must be thread safe.
186 typedef std::function<std::unique_ptr<NativeObjectStream>(unsigned Task)>
188 
189 /// This is the type of a native object cache. To request an item from the
190 /// cache, pass a unique string as the Key. For hits, the cached file will be
191 /// added to the link and this function will return AddStreamFn(). For misses,
192 /// the cache will return a stream callback which must be called at most once to
193 /// produce content for the stream. The native object stream produced by the
194 /// stream callback will add the file to the link after the stream is written
195 /// to.
196 ///
197 /// Clients generally look like this:
198 ///
199 /// if (AddStreamFn AddStream = Cache(Task, Key))
200 /// ProduceContent(AddStream);
201 typedef std::function<AddStreamFn(unsigned Task, StringRef Key)>
203 
204 /// A ThinBackend defines what happens after the thin-link phase during ThinLTO.
205 /// The details of this type definition aren't important; clients can only
206 /// create a ThinBackend using one of the create*ThinBackend() functions below.
207 typedef std::function<std::unique_ptr<ThinBackendProc>(
208  Config &C, ModuleSummaryIndex &CombinedIndex,
209  StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
210  AddStreamFn AddStream, NativeObjectCache Cache)>
212 
213 /// This ThinBackend runs the individual backend jobs in-process.
214 ThinBackend createInProcessThinBackend(unsigned ParallelismLevel);
215 
216 /// This ThinBackend writes individual module indexes to files, instead of
217 /// running the individual backend jobs. This backend is for distributed builds
218 /// where separate processes will invoke the real backends.
219 ///
220 /// To find the path to write the index to, the backend checks if the path has a
221 /// prefix of OldPrefix; if so, it replaces that prefix with NewPrefix. It then
222 /// appends ".thinlto.bc" and writes the index to that path. If
223 /// ShouldEmitImportsFiles is true it also writes a list of imported files to a
224 /// similar path with ".imports" appended instead.
225 /// LinkedObjectsFile is an output stream to write the list of object files for
226 /// the final ThinLTO linking. Can be nullptr.
227 /// OnWrite is callback which receives module identifier and notifies LTO user
228 /// that index file for the module (and optionally imports file) was created.
229 using IndexWriteCallback = std::function<void(const std::string &)>;
230 ThinBackend createWriteIndexesThinBackend(std::string OldPrefix,
231  std::string NewPrefix,
232  bool ShouldEmitImportsFiles,
233  raw_fd_ostream *LinkedObjectsFile,
234  IndexWriteCallback OnWrite);
235 
236 /// This class implements a resolution-based interface to LLVM's LTO
237 /// functionality. It supports regular LTO, parallel LTO code generation and
238 /// ThinLTO. You can use it from a linker in the following way:
239 /// - Set hooks and code generation options (see lto::Config struct defined in
240 /// Config.h), and use the lto::Config object to create an lto::LTO object.
241 /// - Create lto::InputFile objects using lto::InputFile::create(), then use
242 /// the symbols() function to enumerate its symbols and compute a resolution
243 /// for each symbol (see SymbolResolution below).
244 /// - After the linker has visited each input file (and each regular object
245 /// file) and computed a resolution for each symbol, take each lto::InputFile
246 /// and pass it and an array of symbol resolutions to the add() function.
247 /// - Call the getMaxTasks() function to get an upper bound on the number of
248 /// native object files that LTO may add to the link.
249 /// - Call the run() function. This function will use the supplied AddStream
250 /// and Cache functions to add up to getMaxTasks() native object files to
251 /// the link.
252 class LTO {
253  friend InputFile;
254 
255 public:
256  /// Create an LTO object. A default constructed LTO object has a reasonable
257  /// production configuration, but you can customize it by passing arguments to
258  /// this constructor.
259  /// FIXME: We do currently require the DiagHandler field to be set in Conf.
260  /// Until that is fixed, a Config argument is required.
261  LTO(Config Conf, ThinBackend Backend = nullptr,
262  unsigned ParallelCodeGenParallelismLevel = 1);
263  ~LTO();
264 
265  /// Add an input file to the LTO link, using the provided symbol resolutions.
266  /// The symbol resolutions must appear in the enumeration order given by
267  /// InputFile::symbols().
268  Error add(std::unique_ptr<InputFile> Obj, ArrayRef<SymbolResolution> Res);
269 
270  /// Returns an upper bound on the number of tasks that the client may expect.
271  /// This may only be called after all IR object files have been added. For a
272  /// full description of tasks see LTOBackend.h.
273  unsigned getMaxTasks() const;
274 
275  /// Runs the LTO pipeline. This function calls the supplied AddStream
276  /// function to add native object files to the link.
277  ///
278  /// The Cache parameter is optional. If supplied, it will be used to cache
279  /// native object files and add them to the link.
280  ///
281  /// The client will receive at most one callback (via either AddStream or
282  /// Cache) for each task identifier.
283  Error run(AddStreamFn AddStream, NativeObjectCache Cache = nullptr);
284 
285 private:
286  Config Conf;
287 
288  struct RegularLTOState {
289  RegularLTOState(unsigned ParallelCodeGenParallelismLevel, Config &Conf);
291  uint64_t Size = 0;
292  unsigned Align = 0;
293  /// Record if at least one instance of the common was marked as prevailing
294  bool Prevailing = false;
295  };
296  std::map<std::string, CommonResolution> Commons;
297 
298  unsigned ParallelCodeGenParallelismLevel;
299  LTOLLVMContext Ctx;
300  std::unique_ptr<Module> CombinedModule;
301  std::unique_ptr<IRMover> Mover;
302 
303  // This stores the information about a regular LTO module that we have added
304  // to the link. It will either be linked immediately (for modules without
305  // summaries) or after summary-based dead stripping (for modules with
306  // summaries).
307  struct AddedModule {
308  std::unique_ptr<Module> M;
309  std::vector<GlobalValue *> Keep;
310  };
311  std::vector<AddedModule> ModsWithSummaries;
312  } RegularLTO;
313 
314  struct ThinLTOState {
315  ThinLTOState(ThinBackend Backend);
316 
317  ThinBackend Backend;
318  ModuleSummaryIndex CombinedIndex;
320  DenseMap<GlobalValue::GUID, StringRef> PrevailingModuleForGUID;
321  } ThinLTO;
322 
323  // The global resolution for a particular (mangled) symbol name. This is in
324  // particular necessary to track whether each symbol can be internalized.
325  // Because any input file may introduce a new cross-partition reference, we
326  // cannot make any final internalization decisions until all input files have
327  // been added and the client has called run(). During run() we apply
328  // internalization decisions either directly to the module (for regular LTO)
329  // or to the combined index (for ThinLTO).
330  struct GlobalResolution {
331  /// The unmangled name of the global.
332  std::string IRName;
333 
334  /// Keep track if the symbol is visible outside of a module with a summary
335  /// (i.e. in either a regular object or a regular LTO module without a
336  /// summary).
337  bool VisibleOutsideSummary = false;
338 
339  bool UnnamedAddr = true;
340 
341  /// True if module contains the prevailing definition.
342  bool Prevailing = false;
343 
344  /// Returns true if module contains the prevailing definition and symbol is
345  /// an IR symbol. For example when module-level inline asm block is used,
346  /// symbol can be prevailing in module but have no IR name.
347  bool isPrevailingIRSymbol() const { return Prevailing && !IRName.empty(); }
348 
349  /// This field keeps track of the partition number of this global. The
350  /// regular LTO object is partition 0, while each ThinLTO object has its own
351  /// partition number from 1 onwards.
352  ///
353  /// Any global that is defined or used by more than one partition, or that
354  /// is referenced externally, may not be internalized.
355  ///
356  /// Partitions generally have a one-to-one correspondence with tasks, except
357  /// that we use partition 0 for all parallel LTO code generation partitions.
358  /// Any partitioning of the combined LTO object is done internally by the
359  /// LTO backend.
360  unsigned Partition = Unknown;
361 
362  /// Special partition numbers.
363  enum : unsigned {
364  /// A partition number has not yet been assigned to this global.
365  Unknown = -1u,
366 
367  /// This global is either used by more than one partition or has an
368  /// external reference, and therefore cannot be internalized.
369  External = -2u,
370 
371  /// The RegularLTO partition
372  RegularLTO = 0,
373  };
374  };
375 
376  // Global mapping from mangled symbol names to resolutions.
377  StringMap<GlobalResolution> GlobalResolutions;
378 
379  void addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
380  ArrayRef<SymbolResolution> Res, unsigned Partition,
381  bool InSummary);
382 
383  // These functions take a range of symbol resolutions [ResI, ResE) and consume
384  // the resolutions used by a single input module by incrementing ResI. After
385  // these functions return, [ResI, ResE) will refer to the resolution range for
386  // the remaining modules in the InputFile.
387  Error addModule(InputFile &Input, unsigned ModI,
388  const SymbolResolution *&ResI, const SymbolResolution *ResE);
389 
391  addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
392  const SymbolResolution *&ResI, const SymbolResolution *ResE);
393  Error linkRegularLTO(RegularLTOState::AddedModule Mod,
394  bool LivenessFromIndex);
395 
396  Error addThinLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
397  const SymbolResolution *&ResI, const SymbolResolution *ResE);
398 
399  Error runRegularLTO(AddStreamFn AddStream);
400  Error runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache);
401 
402  mutable bool CalledGetMaxTasks = false;
403 
404  // Use Optional to distinguish false from not yet initialized.
405  Optional<bool> EnableSplitLTOUnit;
406 };
407 
408 /// The resolution for a symbol. The linker must provide a SymbolResolution for
409 /// each global symbol based on its internal resolution of that symbol.
412  : Prevailing(0), FinalDefinitionInLinkageUnit(0), VisibleToRegularObj(0),
413  LinkerRedefined(0) {}
414 
415  /// The linker has chosen this definition of the symbol.
416  unsigned Prevailing : 1;
417 
418  /// The definition of this symbol is unpreemptable at runtime and is known to
419  /// be in this linkage unit.
421 
422  /// The definition of this symbol is visible outside of the LTO unit.
423  unsigned VisibleToRegularObj : 1;
424 
425  /// Linker redefined version of the symbol which appeared in -wrap or -defsym
426  /// linker option.
427  unsigned LinkerRedefined : 1;
428 };
429 
430 } // namespace lto
431 } // namespace llvm
432 
433 #endif
NativeObjectStream(std::unique_ptr< raw_pwrite_stream > OS)
Definition: LTO.h:177
uint64_t CallInst * C
GlobalValue::VisibilityTypes getVisibility() const
Definition: IRSymtab.h:186
ArrayRef< Symbol > symbols() const
A range over the symbols in this InputFile.
Definition: LTO.h:146
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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:218
ArrayRef< StringRef > getComdatTable() const
Definition: LTO.h:161
Expected< std::unique_ptr< ToolOutputFile > > setupOptimizationRemarks(LLVMContext &Context, StringRef LTORemarksFilename, bool LTOPassRemarksWithHotness, int Count=-1)
Setup optimization remarks.
Definition: LTO.cpp:1267
LLVMContext & Context
unsigned Prevailing
The linker has chosen this definition of the symbol.
Definition: LTO.h:416
bool isTLS() const
Definition: IRSymtab.h:195
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
Definition: GlobalValue.h:493
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Symbol(const irsymtab::Symbol &S)
Definition: LTO.h:127
cl::opt< std::string > LTORemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename"))
Contains the information needed by linkers for symbol resolution, as well as by the LTO implementatio...
Definition: IRSymtab.h:87
The purpose of this class is to only expose the symbol information that an LTO client should need in ...
Definition: LTO.h:123
unsigned LinkerRedefined
Linker redefined version of the symbol which appeared in -wrap or -defsym linker option.
Definition: LTO.h:427
bool isExecutable() const
Definition: IRSymtab.h:204
The resolution for a symbol.
Definition: LTO.h:410
This class implements a map that also provides access to all stored values in a deterministic order...
Definition: MapVector.h:38
static Expected< std::unique_ptr< InputFile > > create(MemoryBufferRef Object)
Create an InputFile.
Definition: LTO.cpp:390
std::function< void(const std::string &)> IndexWriteCallback
This ThinBackend writes individual module indexes to files, instead of running the individual backend...
Definition: LTO.h:229
bool canBeOmittedFromSymbolTable() const
Definition: IRSymtab.h:197
ThinBackend createWriteIndexesThinBackend(std::string OldPrefix, std::string NewPrefix, bool ShouldEmitImportsFiles, raw_fd_ostream *LinkedObjectsFile, IndexWriteCallback OnWrite)
Definition: LTO.cpp:1152
StringMap< FunctionsToImportTy > ImportMapTy
The map contains an entry for every module to import from, the key being the module identifier to pas...
std::unique_ptr< raw_pwrite_stream > OS
Definition: LTO.h:178
std::function< std::unique_ptr< NativeObjectStream >unsigned Task)> AddStreamFn
This type defines the callback to add a native object that is generated on the fly.
Definition: LTO.h:187
Definition: BitVector.h:938
Represents a module in a bitcode file.
Definition: BitcodeReader.h:58
StringRef getSourceFileName() const
Returns the source file path specified at compile time.
Definition: LTO.h:158
std::unordered_set< GlobalValue::GUID > ExportSetTy
The set contains an entry for every global value the module exports.
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
bool isCommon() const
Definition: IRSymtab.h:192
Key
PAL metadata keys.
StringRef getTargetTriple() const
Returns the input file&#39;s target triple.
Definition: LTO.h:155
DenseMap< GlobalValue::GUID, GlobalValueSummary * > GVSummaryMapTy
Map of global value GUID to its summary, used to identify values defined in a particular module...
cl::opt< bool > LTOPassRemarksWithHotness("lto-pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), cl::Hidden)
bool isUndefined() const
Definition: IRSymtab.h:190
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
An input file.
Definition: LTO.h:96
This class implements a resolution-based interface to LLVM&#39;s LTO functionality.
Definition: LTO.h:252
Class to hold module path string table and global value map, and encapsulate methods for operating on...
StringRef getName() const
Returns the mangled symbol name.
Definition: IRSymtab.h:174
std::unique_ptr< Module > M
Definition: LTO.h:308
std::function< AddStreamFn(unsigned Task, StringRef Key)> NativeObjectCache
This is the type of a native object cache.
Definition: LTO.h:202
uint32_t getCommonAlignment() const
Definition: IRSymtab.h:211
This class wraps an output stream for a native object.
Definition: LTO.h:175
bool isIndirect() const
Definition: IRSymtab.h:193
void thinLTOResolvePrevailingInIndex(ModuleSummaryIndex &Index, function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing, function_ref< void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)> recordNewLinkage)
Resolve linkage for prevailing symbols in the Index.
Definition: LTO.cpp:338
LTO configuration.
Definition: Config.h:36
This represents a symbol that has been read from a storage::Symbol and possibly a storage::Uncommon...
Definition: IRSymtab.h:162
const T * data() const
Definition: ArrayRef.h:146
StringRef getSectionName() const
Definition: IRSymtab.h:223
std::function< std::unique_ptr< ThinBackendProc > Config &C, ModuleSummaryIndex &CombinedIndex, StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries, AddStreamFn AddStream, NativeObjectCache Cache)> ThinBackend
A ThinBackend defines what happens after the thin-link phase during ThinLTO.
Definition: LTO.h:211
int getComdatIndex() const
Returns the index into the comdat table (see Reader::getComdatTable()), or -1 if not a comdat member...
Definition: IRSymtab.h:182
void computeLTOCacheKey(SmallString< 40 > &Key, const lto::Config &Conf, const ModuleSummaryIndex &Index, StringRef ModuleID, const FunctionImporter::ImportMapTy &ImportList, const FunctionImporter::ExportSetTy &ExportList, const std::map< GlobalValue::GUID, GlobalValue::LinkageTypes > &ResolvedODR, const GVSummaryMapTy &DefinedGlobals, const std::set< GlobalValue::GUID > &CfiFunctionDefs={}, const std::set< GlobalValue::GUID > &CfiFunctionDecls={})
Computes a unique hash for the Module considering the current list of export/import and other global ...
Definition: LTO.cpp:69
The access may modify the value stored in memory.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:220
LinkageTypes
An enumeration for the kinds of linkage for global values.
Definition: GlobalValue.h:48
ThinBackend createInProcessThinBackend(unsigned ParallelismLevel)
This ThinBackend runs the individual backend jobs in-process.
Definition: LTO.cpp:1064
bool isWeak() const
Definition: IRSymtab.h:191
std::vector< GlobalValue * > Keep
Definition: LTO.h:309
A raw_ostream that writes to a file descriptor.
Definition: raw_ostream.h:366
#define I(x, y, z)
Definition: MD5.cpp:58
uint32_t Size
Definition: Profile.cpp:47
unsigned VisibleToRegularObj
The definition of this symbol is visible outside of the LTO unit.
Definition: LTO.h:423
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
StringRef getCOFFLinkerOpts() const
Returns linker options specified in the input file.
Definition: LTO.h:149
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
uint64_t getCommonSize() const
Definition: IRSymtab.h:206
A derived class of LLVMContext that initializes itself according to a given Config object...
Definition: Config.h:206
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
unsigned FinalDefinitionInLinkageUnit
The definition of this symbol is unpreemptable at runtime and is known to be in this linkage unit...
Definition: LTO.h:420
std::string getThinLTOOutputFile(const std::string &Path, const std::string &OldPrefix, const std::string &NewPrefix)
Given the original Path to an output file, replace any path prefix matching OldPrefix with NewPrefix...
Definition: LTO.cpp:1077
void thinLTOInternalizeAndPromoteInIndex(ModuleSummaryIndex &Index, function_ref< bool(StringRef, GlobalValue::GUID)> isExported)
Update the linkages in the given Index to mark exported values as external and non-exported values as...
Definition: LTO.cpp:380