From cd513a41c17a3591e764b1ff986ae501a28cc5f5 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 11 Nov 2016 19:50:24 +0000 Subject: Bitcode: Clean up error handling for certain bitcode query functions. The functions getBitcodeTargetTriple(), isBitcodeContainingObjCCategory(), getBitcodeProducerString() and hasGlobalValueSummary() now return errors via their return value rather than via the diagnostic handler. To make this work, re-implement these functions using non-member functions so that they can be used without the LLVMContext required by BitcodeReader. Differential Revision: https://reviews.llvm.org/D26532 llvm-svn: 286623 --- llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp') diff --git a/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp b/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp index 780324dafeec..e597fc20a1fc 100644 --- a/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp +++ b/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp @@ -67,18 +67,6 @@ ModuleSummaryIndexObjectFile::findBitcodeInMemBuffer(MemoryBufferRef Object) { } } -// Looks for module summary index in the given memory buffer. -// returns true if found, else false. -bool ModuleSummaryIndexObjectFile::hasGlobalValueSummaryInMemBuffer( - MemoryBufferRef Object, - const DiagnosticHandlerFunction &DiagnosticHandler) { - ErrorOr BCOrErr = findBitcodeInMemBuffer(Object); - if (!BCOrErr) - return false; - - return hasGlobalValueSummary(BCOrErr.get(), DiagnosticHandler); -} - // Parse module summary index in the given memory buffer. // Return new ModuleSummaryIndexObjectFile instance containing parsed // module summary/index. -- cgit v1.2.3