mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user