mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Simplify interface of function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238700 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -79,8 +79,7 @@ protected:
|
||||
StringRef &Res) const override;
|
||||
std::error_code getSymbolAddress(DataRefImpl Symb,
|
||||
uint64_t &Res) const override;
|
||||
std::error_code getSymbolAlignment(DataRefImpl Symb,
|
||||
uint32_t &Res) const override;
|
||||
uint32_t getSymbolAlignment(DataRefImpl Symb) const override;
|
||||
std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
|
||||
uint32_t getSymbolFlags(DataRefImpl Symb) const override;
|
||||
std::error_code getSymbolOther(DataRefImpl Symb, uint8_t &Res) const override;
|
||||
@ -326,14 +325,11 @@ std::error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
std::error_code ELFObjectFile<ELFT>::getSymbolAlignment(DataRefImpl Symb,
|
||||
uint32_t &Res) const {
|
||||
uint32_t ELFObjectFile<ELFT>::getSymbolAlignment(DataRefImpl Symb) const {
|
||||
Elf_Sym_Iter Sym = toELFSymIter(Symb);
|
||||
if (Sym->st_shndx == ELF::SHN_COMMON)
|
||||
Res = Sym->st_value;
|
||||
else
|
||||
Res = 0;
|
||||
return object_error::success;
|
||||
return Sym->st_value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
@ -204,8 +204,7 @@ public:
|
||||
|
||||
std::error_code getSymbolAddress(DataRefImpl Symb,
|
||||
uint64_t &Res) const override;
|
||||
std::error_code getSymbolAlignment(DataRefImpl Symb,
|
||||
uint32_t &Res) const override;
|
||||
uint32_t getSymbolAlignment(DataRefImpl Symb) const override;
|
||||
std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
|
||||
std::error_code getSymbolType(DataRefImpl Symb,
|
||||
SymbolRef::Type &Res) const override;
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
/// mapped).
|
||||
std::error_code getAddress(uint64_t &Result) const;
|
||||
/// @brief Get the alignment of this symbol as the actual value (not log 2).
|
||||
std::error_code getAlignment(uint32_t &Result) const;
|
||||
uint32_t getAlignment() const;
|
||||
std::error_code getSize(uint64_t &Result) const;
|
||||
std::error_code getType(SymbolRef::Type &Result) const;
|
||||
std::error_code getOther(uint8_t &Result) const;
|
||||
@ -206,8 +206,7 @@ protected:
|
||||
DataRefImpl Symb) const override;
|
||||
virtual std::error_code getSymbolAddress(DataRefImpl Symb,
|
||||
uint64_t &Res) const = 0;
|
||||
virtual std::error_code getSymbolAlignment(DataRefImpl Symb,
|
||||
uint32_t &Res) const;
|
||||
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const;
|
||||
virtual std::error_code getSymbolSize(DataRefImpl Symb,
|
||||
uint64_t &Res) const = 0;
|
||||
virtual std::error_code getSymbolType(DataRefImpl Symb,
|
||||
@ -334,8 +333,8 @@ inline std::error_code SymbolRef::getAddress(uint64_t &Result) const {
|
||||
return getObject()->getSymbolAddress(getRawDataRefImpl(), Result);
|
||||
}
|
||||
|
||||
inline std::error_code SymbolRef::getAlignment(uint32_t &Result) const {
|
||||
return getObject()->getSymbolAlignment(getRawDataRefImpl(), Result);
|
||||
inline uint32_t SymbolRef::getAlignment() const {
|
||||
return getObject()->getSymbolAlignment(getRawDataRefImpl());
|
||||
}
|
||||
|
||||
inline std::error_code SymbolRef::getSize(uint64_t &Result) const {
|
||||
|
Reference in New Issue
Block a user