|
LLVM
4.0.0
|
The function importer is automatically importing function from other modules based on the provided summary informations. More...
#include <FunctionImport.h>
Public Types | |
| typedef std::map < GlobalValue::GUID, unsigned > | FunctionsToImportTy |
| Set of functions to import from a source module. More... | |
| typedef StringMap < FunctionsToImportTy > | ImportMapTy |
| The map contains an entry for every module to import from, the key being the module identifier to pass to the ModuleLoader. More... | |
| typedef std::unordered_set < GlobalValue::GUID > | ExportSetTy |
| The set contains an entry for every global value the module exports. More... | |
| typedef std::function < Expected< std::unique_ptr < Module > >StringRef Identifier)> | ModuleLoaderTy |
| 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< bool > | importFunctions (Module &M, const ImportMapTy &ImportList, bool ForceImportReferencedDiscardableSymbols=false) |
Import functions in Module M based on the supplied import list. More... | |
The function importer is automatically importing function from other modules based on the provided summary informations.
Definition at line 31 of file FunctionImport.h.
| typedef std::unordered_set<GlobalValue::GUID> llvm::FunctionImporter::ExportSetTy |
The set contains an entry for every global value the module exports.
Definition at line 45 of file FunctionImport.h.
| typedef std::map<GlobalValue::GUID, unsigned> llvm::FunctionImporter::FunctionsToImportTy |
Set of functions to import from a source module.
Each entry is a map containing all the functions to import for a source module. The keys is the GUID identifying a function to import, and the value is the threshold applied when deciding to import it.
Definition at line 37 of file FunctionImport.h.
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 42 of file FunctionImport.h.
| typedef std::function<Expected<std::unique_ptr<Module> >StringRef Identifier)> llvm::FunctionImporter::ModuleLoaderTy |
A function of this type is used to load modules referenced by the index.
Definition at line 49 of file FunctionImport.h.
|
inline |
Create a Function Importer.
Definition at line 52 of file FunctionImport.h.
| Expected< bool > FunctionImporter::importFunctions | ( | Module & | M, |
| const ImportMapTy & | ImportList, | ||
| bool | ForceImportReferencedDiscardableSymbols = false |
||
| ) |
Import functions in Module M based on the supplied import list.
ForceImportReferencedDiscardableSymbols will set the ModuleLinker in a mode where referenced discarable symbols in the source modules will be imported as well even if they are not present in the ImportList.
Definition at line 619 of file FunctionImport.cpp.
References assert(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::count(), llvm::dbgs(), DEBUG, EnableImportMetadata, F, fuzzer::Flags, llvm::MDString::get(), llvm::MDNode::get(), llvm::GlobalValue::getBaseObject(), llvm::Module::getContext(), llvm::GlobalValue::getGUID(), llvm::Module::getModuleIdentifier(), llvm::Value::getName(), llvm::Module::getSourceFileName(), llvm::GlobalValue::hasLinkOnceODRLinkage(), llvm::Import, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::Linker::linkInModule(), llvm::GlobalValue::materialize(), llvm::None, PrintImports, llvm::renameModuleForThinLTO(), llvm::report_fatal_error(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::size(), SummaryFile, and llvm::UpgradeDebugInfo().
Referenced by doImportingForModule(), and llvm::lto::thinBackend().
1.8.6