Object: Remove ModuleSummaryIndexObjectFile class.

Differential Revision: https://reviews.llvm.org/D32195

llvm-svn: 301832
This commit is contained in:
Peter Collingbourne
2017-05-01 20:42:32 +00:00
parent ba6c9cb5e8
commit c15d60b772
13 changed files with 35 additions and 261 deletions

View File

@@ -93,6 +93,13 @@ static cl::opt<bool> PrintSummaryGUIDs(
cl::desc(
"Print the global id for each value when reading the module summary"));
// FIXME: This flag should either be removed or moved to clang as a driver flag.
static llvm::cl::opt<bool> IgnoreEmptyThinLTOIndexFile(
"ignore-empty-index-file", llvm::cl::ZeroOrMore,
llvm::cl::desc(
"Ignore an empty index file and perform non-ThinLTO compilation"),
llvm::cl::init(false));
namespace {
enum {
@@ -5609,3 +5616,14 @@ Expected<bool> llvm::hasGlobalValueSummary(MemoryBufferRef Buffer) {
return BM->hasSummary();
}
Expected<std::unique_ptr<ModuleSummaryIndex>>
llvm::getModuleSummaryIndexForFile(StringRef Path) {
ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr =
MemoryBuffer::getFileOrSTDIN(Path);
if (!FileOrErr)
return errorCodeToError(FileOrErr.getError());
if (IgnoreEmptyThinLTOIndexFile && !(*FileOrErr)->getBufferSize())
return nullptr;
return getModuleSummaryIndex(**FileOrErr);
}