diff options
Diffstat (limited to 'include/llvm/LTO/LTO.h')
-rw-r--r-- | include/llvm/LTO/LTO.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/llvm/LTO/LTO.h b/include/llvm/LTO/LTO.h index 2a2b59847281..7d6beab6b441 100644 --- a/include/llvm/LTO/LTO.h +++ b/include/llvm/LTO/LTO.h @@ -19,7 +19,6 @@ #include "llvm/ADT/MapVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringSet.h" -#include "llvm/Analysis/ObjectUtils.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/LTO/Config.h" @@ -210,10 +209,16 @@ ThinBackend createInProcessThinBackend(unsigned ParallelismLevel); /// appends ".thinlto.bc" and writes the index to that path. If /// ShouldEmitImportsFiles is true it also writes a list of imported files to a /// similar path with ".imports" appended instead. +/// LinkedObjectsFile is an output stream to write the list of object files for +/// the final ThinLTO linking. Can be nullptr. +/// OnWrite is callback which receives module identifier and notifies LTO user +/// that index file for the module (and optionally imports file) was created. +using IndexWriteCallback = std::function<void(const std::string &)>; ThinBackend createWriteIndexesThinBackend(std::string OldPrefix, std::string NewPrefix, bool ShouldEmitImportsFiles, - std::string LinkedObjectsFile); + raw_fd_ostream *LinkedObjectsFile, + IndexWriteCallback OnWrite); /// This class implements a resolution-based interface to LLVM's LTO /// functionality. It supports regular LTO, parallel LTO code generation and @@ -320,6 +325,14 @@ private: bool UnnamedAddr = true; + /// True if module contains the prevailing definition. + bool Prevailing = false; + + /// Returns true if module contains the prevailing definition and symbol is + /// an IR symbol. For example when module-level inline asm block is used, + /// symbol can be prevailing in module but have no IR name. + bool isPrevailingIRSymbol() const { return Prevailing && !IRName.empty(); } + /// This field keeps track of the partition number of this global. The /// regular LTO object is partition 0, while each ThinLTO object has its own /// partition number from 1 onwards. |