mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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<MemoryBufferRef> 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.
|
||||
|
||||
Reference in New Issue
Block a user