LLVM  8.0.1
Classes | Public Member Functions | List of all members
llvm::lto::LTO Class Reference

This class implements a resolution-based interface to LLVM's LTO functionality. More...

#include "llvm/LTO/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...
 

Detailed Description

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:

Definition at line 252 of file LTO.h.

Constructor & Destructor Documentation

◆ LTO()

LTO::LTO ( Config  Conf,
ThinBackend  Backend = nullptr,
unsigned  ParallelCodeGenParallelismLevel = 1 
)

Create an LTO object.

A default constructed LTO object has a reasonable production configuration, but you can customize it by passing arguments to this constructor. FIXME: We do currently require the DiagHandler field to be set in Conf. Until that is fixed, a Config argument is required.

Definition at line 435 of file LTO.cpp.

References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::Value::getName(), llvm::lto::SymbolResolution::LinkerRedefined, Name, llvm::lto::SymbolResolution::Prevailing, llvm::StringRef::startswith(), llvm::StringRef::substr(), llvm::Unknown, llvm::lto::SymbolResolution::VisibleToRegularObj, and ~LTO().

◆ ~LTO()

LTO::~LTO ( )
default

Referenced by LTO().

Member Function Documentation

◆ add()

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 523 of file LTO.cpp.

References assert(), llvm::ArrayRef< T >::begin(), I, llvm::lto::Config::ResolutionFile, and writeToResolutionFile().

◆ getMaxTasks()

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.

Definition at line 807 of file LTO.cpp.

◆ run()

Error LTO::run ( AddStreamFn  AddStream,
NativeObjectCache  Cache = nullptr 
)

The documentation for this class was generated from the following files: