Update the MemoryBuffer API to use ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-07-06 17:43:13 +00:00
parent 04e43e64a9
commit 7cba2a973f
35 changed files with 296 additions and 279 deletions

View File

@@ -88,10 +88,10 @@ bool lto_module_is_object_file(const char* path) {
bool lto_module_is_object_file_for_target(const char* path,
const char* target_triplet_prefix) {
std::unique_ptr<MemoryBuffer> buffer;
if (MemoryBuffer::getFile(path, buffer))
ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer = MemoryBuffer::getFile(path);
if (!Buffer)
return false;
return LTOModule::isBitcodeForTarget(buffer.get(), target_triplet_prefix);
return LTOModule::isBitcodeForTarget(Buffer->get(), target_triplet_prefix);
}
bool lto_module_is_object_file_in_memory(const void* mem, size_t length) {