summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionImport.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-03-14 21:18:10 +0000
committerTeresa Johnson <tejohnson@google.com>2016-03-14 21:18:10 +0000
commitcec0cae31325ef45950d3a8d0c1f2702df04d689 (patch)
tree11a78eb4957d801e923aeb457789660798d1b89d /llvm/lib/Transforms/IPO/FunctionImport.cpp
parent9c6cd5df8c1d917084e2cbf8ec8eca6a3550a97e (diff)
downloadbcm5719-llvm-cec0cae31325ef45950d3a8d0c1f2702df04d689.tar.gz
bcm5719-llvm-cec0cae31325ef45950d3a8d0c1f2702df04d689.zip
Revert "[ThinLTO] Renaming of function index to module summary index (NFC)"
This reverts commit r263490. Missed a file. llvm-svn: 263493
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 90b36aab363..8aa97535170 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -20,7 +20,7 @@
#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Linker/Linker.h"
-#include "llvm/Object/ModuleSummaryIndexObjectFile.h"
+#include "llvm/Object/FunctionIndexObjectFile.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SourceMgr.h"
@@ -111,7 +111,7 @@ Module &ModuleLazyLoaderCache::operator()(StringRef Identifier) {
/// calls not already in the \p VisitedFunctions map. If any are
/// found they are added to the \p Worklist for importing.
static void findExternalCalls(
- const Module &DestModule, Function &F, const ModuleSummaryIndex &Index,
+ const Module &DestModule, Function &F, const FunctionInfoIndex &Index,
VisitedFunctionTrackerTy &VisitedFunctions, unsigned Threshold,
SmallVectorImpl<std::pair<StringRef, unsigned>> &Worklist) {
// We need to suffix internal function calls imported from other modules,
@@ -141,7 +141,7 @@ static void findExternalCalls(
if (CalledFunction->hasInternalLinkage()) {
ImportedName = Renamed;
}
- // Compute the global identifier used in the summary index.
+ // Compute the global identifier used in the function index.
auto CalledFunctionGlobalID = Function::getGlobalIdentifier(
CalledFunction->getName(), CalledFunction->getLinkage(),
CalledFunction->getParent()->getSourceFileName());
@@ -192,9 +192,9 @@ static void
GetImportList(Module &DestModule,
SmallVectorImpl<std::pair<StringRef, unsigned>> &Worklist,
VisitedFunctionTrackerTy &VisitedFunctions,
- std::map<StringRef, DenseSet<const GlobalValue *>>
- &ModuleToFunctionsToImportMap,
- const ModuleSummaryIndex &Index,
+ std::map<StringRef, DenseSet<const GlobalValue *>> &
+ ModuleToFunctionsToImportMap,
+ const FunctionInfoIndex &Index,
ModuleLazyLoaderCache &ModuleLoaderCache) {
while (!Worklist.empty()) {
StringRef CalledFunctionName;
@@ -374,11 +374,11 @@ static void diagnosticHandler(const DiagnosticInfo &DI) {
OS << '\n';
}
-/// Parse the summary index out of an IR file and return the summary
+/// Parse the function index out of an IR file and return the function
/// index object if found, or nullptr if not.
-static std::unique_ptr<ModuleSummaryIndex>
-getModuleSummaryIndexForFile(StringRef Path, std::string &Error,
- DiagnosticHandlerFunction DiagnosticHandler) {
+static std::unique_ptr<FunctionInfoIndex>
+getFunctionIndexForFile(StringRef Path, std::string &Error,
+ DiagnosticHandlerFunction DiagnosticHandler) {
std::unique_ptr<MemoryBuffer> Buffer;
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
MemoryBuffer::getFile(Path);
@@ -387,9 +387,9 @@ getModuleSummaryIndexForFile(StringRef Path, std::string &Error,
return nullptr;
}
Buffer = std::move(BufferOrErr.get());
- ErrorOr<std::unique_ptr<object::ModuleSummaryIndexObjectFile>> ObjOrErr =
- object::ModuleSummaryIndexObjectFile::create(Buffer->getMemBufferRef(),
- DiagnosticHandler);
+ ErrorOr<std::unique_ptr<object::FunctionIndexObjectFile>> ObjOrErr =
+ object::FunctionIndexObjectFile::create(Buffer->getMemBufferRef(),
+ DiagnosticHandler);
if (std::error_code EC = ObjOrErr.getError()) {
Error = EC.message();
return nullptr;
@@ -400,9 +400,9 @@ getModuleSummaryIndexForFile(StringRef Path, std::string &Error,
namespace {
/// Pass that performs cross-module function import provided a summary file.
class FunctionImportPass : public ModulePass {
- /// Optional module summary index to use for importing, otherwise
+ /// Optional function summary index to use for importing, otherwise
/// the summary-file option must be specified.
- const ModuleSummaryIndex *Index;
+ const FunctionInfoIndex *Index;
public:
/// Pass identification, replacement for typeid
@@ -413,20 +413,19 @@ public:
return "Function Importing";
}
- explicit FunctionImportPass(const ModuleSummaryIndex *Index = nullptr)
+ explicit FunctionImportPass(const FunctionInfoIndex *Index = nullptr)
: ModulePass(ID), Index(Index) {}
bool runOnModule(Module &M) override {
if (SummaryFile.empty() && !Index)
report_fatal_error("error: -function-import requires -summary-file or "
"file from frontend\n");
- std::unique_ptr<ModuleSummaryIndex> IndexPtr;
+ std::unique_ptr<FunctionInfoIndex> IndexPtr;
if (!SummaryFile.empty()) {
if (Index)
report_fatal_error("error: -summary-file and index from frontend\n");
std::string Error;
- IndexPtr =
- getModuleSummaryIndexForFile(SummaryFile, Error, diagnosticHandler);
+ IndexPtr = getFunctionIndexForFile(SummaryFile, Error, diagnosticHandler);
if (!IndexPtr) {
errs() << "Error loading file '" << SummaryFile << "': " << Error
<< "\n";
@@ -459,7 +458,7 @@ INITIALIZE_PASS_END(FunctionImportPass, "function-import",
"Summary Based Function Import", false, false)
namespace llvm {
-Pass *createFunctionImportPass(const ModuleSummaryIndex *Index = nullptr) {
+Pass *createFunctionImportPass(const FunctionInfoIndex *Index = nullptr) {
return new FunctionImportPass(Index);
}
}
OpenPOWER on IntegriCloud