mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-30 02:11:38 +00:00
Object: Remove ModuleSummaryIndexObjectFile class.
Differential Revision: https://reviews.llvm.org/D32195 llvm-svn: 301832
This commit is contained in:
1 parent
ba6c9cb5e8
commit
c15d60b772
13 files changed
+35
-261
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user