diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-03-15 00:04:37 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-03-15 00:04:37 +0000 |
commit | f2403fe5b55fe2e48b2d3401e177a213cf3402f9 (patch) | |
tree | 14bf46d1c6f62cbd259d766d79804160440ecc09 /tools/llvm-link | |
parent | a27966ebf6c5985d27b8e0024e5f0ffcadce861c (diff) |
[ThinLTO] Renaming of function index to module summary index (NFC)
(Resubmitting after fixing missing file issue)
With the changes in r263275, there are now more than just functions in
the summary. Completed the renaming of data structures (started in
r263275) to reflect the wider scope. In particular, changed the
FunctionIndex* data structures to ModuleIndex*, and renamed related
variables and comments. Also renamed the files to reflect the changes.
A companion clang patch will immediately succeed this patch to reflect
this renaming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r-- | tools/llvm-link/llvm-link.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index cdf057fdc66..d886bd177c2 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -12,18 +12,18 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Linker/Linker.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/AutoUpgrade.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/DiagnosticPrinter.h" -#include "llvm/IR/FunctionInfo.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" +#include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/IR/Verifier.h" #include "llvm/IRReader/IRReader.h" -#include "llvm/Object/FunctionIndexObjectFile.h" +#include "llvm/Linker/Linker.h" +#include "llvm/Object/ModuleSummaryIndexObjectFile.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/ManagedStatic.h" @@ -52,15 +52,14 @@ static cl::list<std::string> Imports( cl::desc("Pair of function name and filename, where function should be " "imported from bitcode in filename")); -// Option to support testing of function importing. The function index +// Option to support testing of function importing. The module summary // must be specified in the case were we request imports via the -import // option, as well as when compiling any module with functions that may be // exported (imported by a different llvm-link -import invocation), to ensure // consistent promotion and renaming of locals. -static cl::opt<std::string> FunctionIndex("functionindex", - cl::desc("Function index filename"), - cl::init(""), - cl::value_desc("filename")); +static cl::opt<std::string> + SummaryIndex("summary-index", cl::desc("Module summary index filename"), + cl::init(""), cl::value_desc("filename")); static cl::opt<std::string> OutputFilename("o", cl::desc("Override output filename"), cl::init("-"), @@ -192,10 +191,10 @@ static bool importFunctions(const char *argv0, LLVMContext &Context, if (Verbose) errs() << "Importing " << FunctionName << " from " << FileName << "\n"; - std::unique_ptr<FunctionInfoIndex> Index; - if (!FunctionIndex.empty()) { - ErrorOr<std::unique_ptr<FunctionInfoIndex>> IndexOrErr = - llvm::getFunctionIndexForFile(FunctionIndex, diagnosticHandler); + std::unique_ptr<ModuleSummaryIndex> Index; + if (!SummaryIndex.empty()) { + ErrorOr<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr = + llvm::getModuleSummaryIndexForFile(SummaryIndex, diagnosticHandler); std::error_code EC = IndexOrErr.getError(); if (EC) { errs() << EC.message() << '\n'; @@ -259,12 +258,12 @@ static bool linkFiles(const char *argv0, LLVMContext &Context, Linker &L, return false; } - // If a function index is supplied, load it so linkInModule can treat + // If a module summary index is supplied, load it so linkInModule can treat // local functions/variables as exported and promote if necessary. - std::unique_ptr<FunctionInfoIndex> Index; - if (!FunctionIndex.empty()) { - ErrorOr<std::unique_ptr<FunctionInfoIndex>> IndexOrErr = - llvm::getFunctionIndexForFile(FunctionIndex, diagnosticHandler); + std::unique_ptr<ModuleSummaryIndex> Index; + if (!SummaryIndex.empty()) { + ErrorOr<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr = + llvm::getModuleSummaryIndexForFile(SummaryIndex, diagnosticHandler); std::error_code EC = IndexOrErr.getError(); if (EC) { errs() << EC.message() << '\n'; |