|
LLVM
4.0.0
|
This class implements a resolution-based interface to LLVM's LTO functionality. More...
#include <LTO.h>
Public Member Functions | |
| LTO (Config Conf, ThinBackend Backend=nullptr, unsigned ParallelCodeGenParallelismLevel=1) | |
| Create an LTO object. More... | |
| ~LTO () | |
| Error | add (std::unique_ptr< InputFile > Obj, ArrayRef< SymbolResolution > Res) |
| Add an input file to the LTO link, using the provided symbol resolutions. More... | |
| unsigned | getMaxTasks () const |
| Returns an upper bound on the number of tasks that the client may expect. More... | |
| Error | run (AddStreamFn AddStream, NativeObjectCache Cache=nullptr) |
| Runs the LTO pipeline. More... | |
This class implements a resolution-based interface to LLVM's LTO functionality.
It supports regular LTO, parallel LTO code generation and ThinLTO. You can use it from a linker in the following way:
| LTO::LTO | ( | Config | Conf, |
| ThinBackend | Backend = nullptr, |
||
| unsigned | ParallelCodeGenParallelismLevel = 1 |
||
| ) |
|
default |
| Error LTO::add | ( | std::unique_ptr< InputFile > | Obj, |
| ArrayRef< SymbolResolution > | Res | ||
| ) |
Add an input file to the LTO link, using the provided symbol resolutions.
The symbol resolutions must appear in the enumeration order given by InputFile::symbols().
Definition at line 378 of file LTO.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::lto::Config::ResolutionFile, llvm::Error::success(), and writeToResolutionFile().
| unsigned LTO::getMaxTasks | ( | ) | const |
Returns an upper bound on the number of tasks that the client may expect.
This may only be called after all IR object files have been added. For a full description of tasks see LTOBackend.h.
| Error LTO::run | ( | AddStreamFn | AddStream, |
| NativeObjectCache | Cache = nullptr |
||
| ) |
Runs the LTO pipeline.
This function calls the supplied AddStream function to add native object files to the link.
The Cache parameter is optional. If supplied, it will be used to cache native object files and add them to the link.
The client will receive at most one callback (via either AddStream or Cache) for each task identifier.
Definition at line 535 of file LTO.cpp.
References E.
1.8.6