mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-07 08:24:27 +00:00
Don't return error_code from a function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -679,9 +679,9 @@ protected:
|
||||
uint64_t getRelocationOffset(DataRefImpl Rel) const override;
|
||||
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
|
||||
uint64_t getRelocationType(DataRefImpl Rel) const override;
|
||||
std::error_code
|
||||
getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
void getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
|
||||
public:
|
||||
COFFObjectFile(MemoryBufferRef Object, std::error_code &EC);
|
||||
basic_symbol_iterator symbol_begin_impl() const override;
|
||||
|
@ -234,9 +234,8 @@ protected:
|
||||
uint64_t getRelocationOffset(DataRefImpl Rel) const override;
|
||||
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
|
||||
uint64_t getRelocationType(DataRefImpl Rel) const override;
|
||||
std::error_code
|
||||
getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
void getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
|
||||
uint32_t getSectionType(DataRefImpl Sec) const override;
|
||||
uint64_t getSectionFlags(DataRefImpl Sec) const override;
|
||||
@ -738,17 +737,10 @@ StringRef ELFObjectFile<ELFT>::getRelocationTypeName(uint32_t Type) const {
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
std::error_code ELFObjectFile<ELFT>::getRelocationTypeName(
|
||||
void ELFObjectFile<ELFT>::getRelocationTypeName(
|
||||
DataRefImpl Rel, SmallVectorImpl<char> &Result) const {
|
||||
const Elf_Shdr *sec = getRelSection(Rel);
|
||||
uint32_t type;
|
||||
if (sec->sh_type == ELF::SHT_REL)
|
||||
type = getRel(Rel)->getType(EF.isMips64EL());
|
||||
else
|
||||
type = getRela(Rel)->getType(EF.isMips64EL());
|
||||
|
||||
uint32_t type = getRelocationType(Rel);
|
||||
EF.getRelocationTypeName(type, Result);
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
@ -241,9 +241,8 @@ public:
|
||||
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
|
||||
section_iterator getRelocationSection(DataRefImpl Rel) const;
|
||||
uint64_t getRelocationType(DataRefImpl Rel) const override;
|
||||
std::error_code
|
||||
getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
void getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
uint8_t getRelocationLength(DataRefImpl Rel) const;
|
||||
|
||||
// MachO specific.
|
||||
|
@ -58,8 +58,7 @@ public:
|
||||
/// @brief Get a string that represents the type of this relocation.
|
||||
///
|
||||
/// This is for display purposes only.
|
||||
std::error_code getTypeName(SmallVectorImpl<char> &Result) const;
|
||||
|
||||
void getTypeName(SmallVectorImpl<char> &Result) const;
|
||||
|
||||
DataRefImpl getRawDataRefImpl() const;
|
||||
const ObjectFile *getObject() const;
|
||||
@ -238,9 +237,8 @@ protected:
|
||||
virtual uint64_t getRelocationOffset(DataRefImpl Rel) const = 0;
|
||||
virtual symbol_iterator getRelocationSymbol(DataRefImpl Rel) const = 0;
|
||||
virtual uint64_t getRelocationType(DataRefImpl Rel) const = 0;
|
||||
virtual std::error_code
|
||||
getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const = 0;
|
||||
virtual void getRelocationTypeName(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const = 0;
|
||||
|
||||
public:
|
||||
uint64_t getCommonSymbolSize(DataRefImpl Symb) const {
|
||||
@ -457,8 +455,7 @@ inline uint64_t RelocationRef::getType() const {
|
||||
return OwningObject->getRelocationType(RelocationPimpl);
|
||||
}
|
||||
|
||||
inline std::error_code
|
||||
RelocationRef::getTypeName(SmallVectorImpl<char> &Result) const {
|
||||
inline void RelocationRef::getTypeName(SmallVectorImpl<char> &Result) const {
|
||||
return OwningObject->getRelocationTypeName(RelocationPimpl, Result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user