mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-02 05:17:15 +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:
@@ -83,8 +83,9 @@ ObjectFile::createObjectFile(std::unique_ptr<MemoryBuffer> &Object,
|
||||
}
|
||||
|
||||
ErrorOr<ObjectFile *> ObjectFile::createObjectFile(StringRef ObjectPath) {
|
||||
std::unique_ptr<MemoryBuffer> File;
|
||||
if (std::error_code EC = MemoryBuffer::getFile(ObjectPath, File))
|
||||
ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr =
|
||||
MemoryBuffer::getFile(ObjectPath);
|
||||
if (std::error_code EC = FileOrErr.getError())
|
||||
return EC;
|
||||
return createObjectFile(File);
|
||||
return createObjectFile(FileOrErr.get());
|
||||
}
|
||||
|
Reference in New Issue
Block a user