From 4cd12ce9a043c469f6c485075990f867855b4989 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Fri, 12 May 2017 19:32:11 +0000 Subject: [PATCH] Remove ignore-empty-index-file option Summary: As discussed in the D32195 review thread and on IRC, remove this option and replace with parameter, which will be set to true when invoked from clang in the context of a ThinLTO distributed backend. Reviewers: pcc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D33133 llvm-svn: 302939 --- llvm/include/llvm/Bitcode/BitcodeReader.h | 5 +++-- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 10 ++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/Bitcode/BitcodeReader.h b/llvm/include/llvm/Bitcode/BitcodeReader.h index 54f990d..31ffb76 100644 --- a/llvm/include/llvm/Bitcode/BitcodeReader.h +++ b/llvm/include/llvm/Bitcode/BitcodeReader.h @@ -152,10 +152,11 @@ namespace llvm { /// Parse the module summary index out of an IR file and return the module /// summary index object if found, or an empty summary if not. If Path refers - /// to an empty file and the -ignore-empty-index-file cl::opt flag is passed + /// to an empty file and IgnoreEmptyThinLTOIndexFile is true, then /// this function will return nullptr. Expected> - getModuleSummaryIndexForFile(StringRef Path); + getModuleSummaryIndexForFile(StringRef Path, + bool IgnoreEmptyThinLTOIndexFile = false); /// isBitcodeWrapper - Return true if the given bytes are the magic bytes /// for an LLVM IR bitcode wrapper. diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 900d718..7629812 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -93,13 +93,6 @@ static cl::opt 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 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 { @@ -5663,7 +5656,8 @@ Expected llvm::hasGlobalValueSummary(MemoryBufferRef Buffer) { } Expected> -llvm::getModuleSummaryIndexForFile(StringRef Path) { +llvm::getModuleSummaryIndexForFile(StringRef Path, + bool IgnoreEmptyThinLTOIndexFile) { ErrorOr> FileOrErr = MemoryBuffer::getFileOrSTDIN(Path); if (!FileOrErr) -- 2.7.4