mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Simplify another function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -236,16 +236,12 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
|
||||
return Result;
|
||||
}
|
||||
|
||||
std::error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,
|
||||
uint64_t &Result) const {
|
||||
uint64_t COFFObjectFile::getSymbolSize(DataRefImpl Ref) const {
|
||||
COFFSymbolRef Symb = getCOFFSymbol(Ref);
|
||||
|
||||
if (Symb.isCommon())
|
||||
Result = Symb.getValue();
|
||||
else
|
||||
Result = UnknownAddressOrSize;
|
||||
|
||||
return object_error::success;
|
||||
return Symb.getValue();
|
||||
return UnknownAddressOrSize;
|
||||
}
|
||||
|
||||
std::error_code
|
||||
|
@ -410,16 +410,13 @@ uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
|
||||
uint64_t &Result) const {
|
||||
uint64_t MachOObjectFile::getSymbolSize(DataRefImpl DRI) const {
|
||||
uint64_t Value;
|
||||
getSymbolAddress(DRI, Value);
|
||||
uint32_t flags = getSymbolFlags(DRI);
|
||||
if (flags & SymbolRef::SF_Common)
|
||||
Result = Value;
|
||||
else
|
||||
Result = UnknownAddressOrSize;
|
||||
return object_error::success;
|
||||
return Value;
|
||||
return UnknownAddressOrSize;
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
|
||||
|
@ -187,10 +187,7 @@ uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI) {
|
||||
}
|
||||
|
||||
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI) {
|
||||
uint64_t ret;
|
||||
if (std::error_code ec = (*unwrap(SI))->getSize(ret))
|
||||
report_fatal_error(ec.message());
|
||||
return ret;
|
||||
return (*unwrap(SI))->getSize();
|
||||
}
|
||||
|
||||
// RelocationRef accessors
|
||||
|
Reference in New Issue
Block a user