mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255578 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
//===- llvm/Transforms/IPO/FunctionImport.h - ThinLTO importing -*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_FUNCTIONIMPORT_H
|
|
#define LLVM_FUNCTIONIMPORT_H
|
|
|
|
#include "llvm/ADT/StringMap.h"
|
|
#include <functional>
|
|
|
|
namespace llvm {
|
|
class LLVMContext;
|
|
class Module;
|
|
class FunctionInfoIndex;
|
|
|
|
/// The function importer is automatically importing function from other modules
|
|
/// based on the provided summary informations.
|
|
class FunctionImporter {
|
|
|
|
/// The summaries index used to trigger importing.
|
|
const FunctionInfoIndex &Index;
|
|
|
|
/// Factory function to load a Module for a given identifier
|
|
std::function<std::unique_ptr<Module>(StringRef Identifier)> ModuleLoader;
|
|
|
|
public:
|
|
/// Create a Function Importer.
|
|
FunctionImporter(
|
|
const FunctionInfoIndex &Index,
|
|
std::function<std::unique_ptr<Module>(StringRef Identifier)> ModuleLoader)
|
|
: Index(Index), ModuleLoader(ModuleLoader) {}
|
|
|
|
/// Import functions in Module \p M based on the summary informations.
|
|
bool importFunctions(Module &M);
|
|
};
|
|
}
|
|
|
|
#endif // LLVM_FUNCTIONIMPORT_H
|