mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Use ErrorOr in getRelocationAdress.
We can probably do better in this method, but this is an improvement and enables further ErrorOr cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -192,10 +192,10 @@ uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI) {
|
||||
|
||||
// RelocationRef accessors
|
||||
uint64_t LLVMGetRelocationAddress(LLVMRelocationIteratorRef RI) {
|
||||
uint64_t ret;
|
||||
if (std::error_code ec = (*unwrap(RI))->getAddress(ret))
|
||||
report_fatal_error(ec.message());
|
||||
return ret;
|
||||
ErrorOr<uint64_t> Ret = (*unwrap(RI))->getAddress();
|
||||
if (std::error_code EC = Ret.getError())
|
||||
report_fatal_error(EC.message());
|
||||
return *Ret;
|
||||
}
|
||||
|
||||
uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI) {
|
||||
|
Reference in New Issue
Block a user