Files
archived-llvm/include/llvm/Transforms/IPO/FunctionImport.h
Rafael Espindola bc8e1bc457 A better attempt to add a missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 23:34:35 +00:00

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