LLVM  8.0.0svn
Classes | Public Types | Public Member Functions | List of all members
llvm::FunctionImporter Class Reference

The function importer is automatically importing function from other modules based on the provided summary informations. More...

#include "llvm/Transforms/IPO/FunctionImport.h"

Classes

struct  ImportFailureInfo
 Information optionally tracked for candidates the importer decided not to import. More...
 

Public Types

enum  ImportFailureReason {
  None, GlobalVar, NotLive, TooLarge,
  InterposableLinkage, LocalLinkageNotInModule, NotEligible
}
 The different reasons selectCallee will chose not to import a candidate. More...
 
using FunctionsToImportTy = std::unordered_set< GlobalValue::GUID >
 Set of functions to import from a source module. More...
 
using ImportThresholdsTy = DenseMap< GlobalValue::GUID, std::tuple< unsigned, const GlobalValueSummary *, std::unique_ptr< ImportFailureInfo > >>
 Map of callee GUID considered for import into a given module to a pair consisting of the largest threshold applied when deciding whether to import it and, if we decided to import, a pointer to the summary instance imported. More...
 
using ImportMapTy = StringMap< FunctionsToImportTy >
 The map contains an entry for every module to import from, the key being the module identifier to pass to the ModuleLoader. More...
 
using ExportSetTy = std::unordered_set< GlobalValue::GUID >
 The set contains an entry for every global value the module exports. More...
 
using ModuleLoaderTy = std::function< Expected< std::unique_ptr< Module > >(StringRef Identifier)>
 A function of this type is used to load modules referenced by the index. More...
 

Public Member Functions

 FunctionImporter (const ModuleSummaryIndex &Index, ModuleLoaderTy ModuleLoader)
 Create a Function Importer. More...
 
Expected< boolimportFunctions (Module &M, const ImportMapTy &ImportList)
 Import functions in Module M based on the supplied import list. More...
 

Detailed Description

The function importer is automatically importing function from other modules based on the provided summary informations.

Definition at line 34 of file FunctionImport.h.

Member Typedef Documentation

◆ ExportSetTy

The set contains an entry for every global value the module exports.

Definition at line 98 of file FunctionImport.h.

◆ FunctionsToImportTy

Set of functions to import from a source module.

Each entry is a set containing all the GUIDs of all functions to import for a source module.

Definition at line 38 of file FunctionImport.h.

◆ ImportMapTy

The map contains an entry for every module to import from, the key being the module identifier to pass to the ModuleLoader.

The value is the set of functions to import.

Definition at line 95 of file FunctionImport.h.

◆ ImportThresholdsTy

Map of callee GUID considered for import into a given module to a pair consisting of the largest threshold applied when deciding whether to import it and, if we decided to import, a pointer to the summary instance imported.

If we decided not to import, the summary will be nullptr.

Definition at line 90 of file FunctionImport.h.

◆ ModuleLoaderTy

A function of this type is used to load modules referenced by the index.

Definition at line 102 of file FunctionImport.h.

Member Enumeration Documentation

◆ ImportFailureReason

The different reasons selectCallee will chose not to import a candidate.

Enumerator
None 
GlobalVar 
NotLive 
TooLarge 
InterposableLinkage 
LocalLinkageNotInModule 
NotEligible 

Definition at line 42 of file FunctionImport.h.

Constructor & Destructor Documentation

◆ FunctionImporter()

llvm::FunctionImporter::FunctionImporter ( const ModuleSummaryIndex Index,
ModuleLoaderTy  ModuleLoader 
)
inline

Create a Function Importer.

Definition at line 105 of file FunctionImport.h.

References importFunctions().

Member Function Documentation

◆ importFunctions()

Expected< bool > FunctionImporter::importFunctions ( Module M,
const ImportMapTy ImportList 
)

Import functions in Module M based on the supplied import list.

Definition at line 1013 of file FunctionImport.cpp.

References assert(), llvm::dbgs(), llvm::Module::getContext(), llvm::Module::getModuleIdentifier(), LLVM_DEBUG, and Name.

Referenced by doImportingForModule(), and FunctionImporter().


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