mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +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:
@ -595,15 +595,13 @@ void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
|
||||
++Rel.d.b;
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel,
|
||||
uint64_t &Res) const {
|
||||
ErrorOr<uint64_t> MachOObjectFile::getRelocationAddress(DataRefImpl Rel) const {
|
||||
uint64_t Offset = getRelocationOffset(Rel);
|
||||
|
||||
DataRefImpl Sec;
|
||||
Sec.d.a = Rel.d.a;
|
||||
uint64_t SecAddress = getSectionAddress(Sec);
|
||||
Res = SecAddress + Offset;
|
||||
return std::error_code();
|
||||
return SecAddress + Offset;
|
||||
}
|
||||
|
||||
uint64_t MachOObjectFile::getRelocationOffset(DataRefImpl Rel) const {
|
||||
|
Reference in New Issue
Block a user