mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ef6ddcf87a
commit
7d17722343
@ -414,17 +414,10 @@ protected:
|
||||
getRelocationValueString(DataRefImpl Rel,
|
||||
SmallVectorImpl<char> &Result) const override;
|
||||
|
||||
std::error_code getLibraryNext(DataRefImpl LibData,
|
||||
LibraryRef &Result) const override;
|
||||
std::error_code getLibraryPath(DataRefImpl LibData,
|
||||
StringRef &Result) const override;
|
||||
|
||||
public:
|
||||
COFFObjectFile(std::unique_ptr<MemoryBuffer> Object, std::error_code &EC);
|
||||
basic_symbol_iterator symbol_begin_impl() const override;
|
||||
basic_symbol_iterator symbol_end_impl() const override;
|
||||
library_iterator needed_library_begin() const override;
|
||||
library_iterator needed_library_end() const override;
|
||||
section_iterator section_begin() const override;
|
||||
section_iterator section_end() const override;
|
||||
|
||||
|
@ -71,11 +71,6 @@ protected:
|
||||
std::error_code getSymbolSection(DataRefImpl Symb,
|
||||
section_iterator &Res) const override;
|
||||
|
||||
std::error_code getLibraryNext(DataRefImpl Data,
|
||||
LibraryRef &Result) const override;
|
||||
std::error_code getLibraryPath(DataRefImpl Data,
|
||||
StringRef &Res) const override;
|
||||
|
||||
void moveSectionNext(DataRefImpl &Sec) const override;
|
||||
std::error_code getSectionName(DataRefImpl Sec,
|
||||
StringRef &Res) const override;
|
||||
@ -191,9 +186,6 @@ public:
|
||||
section_iterator section_begin() const override;
|
||||
section_iterator section_end() const override;
|
||||
|
||||
library_iterator needed_library_begin() const override;
|
||||
library_iterator needed_library_end() const override;
|
||||
|
||||
std::error_code getRelocationAddend(DataRefImpl Rel, int64_t &Res) const;
|
||||
std::error_code getSymbolVersion(SymbolRef Symb, StringRef &Version,
|
||||
bool &IsDefault) const;
|
||||
@ -837,44 +829,6 @@ StringRef ELFObjectFile<ELFT>::getLoadName() const {
|
||||
return "";
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
library_iterator ELFObjectFile<ELFT>::needed_library_begin() const {
|
||||
Elf_Dyn_Iter DI = EF.begin_dynamic_table();
|
||||
Elf_Dyn_Iter DE = EF.end_dynamic_table();
|
||||
|
||||
while (DI != DE && DI->getTag() != ELF::DT_SONAME)
|
||||
++DI;
|
||||
|
||||
return library_iterator(LibraryRef(toDRI(DI), this));
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
std::error_code ELFObjectFile<ELFT>::getLibraryNext(DataRefImpl Data,
|
||||
LibraryRef &Result) const {
|
||||
Elf_Dyn_Iter DI = toELFDynIter(Data);
|
||||
Elf_Dyn_Iter DE = EF.end_dynamic_table();
|
||||
|
||||
// Skip to the next DT_NEEDED entry.
|
||||
do
|
||||
++DI;
|
||||
while (DI != DE && DI->getTag() != ELF::DT_NEEDED);
|
||||
|
||||
Result = LibraryRef(toDRI(DI), this);
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
std::error_code ELFObjectFile<ELFT>::getLibraryPath(DataRefImpl Data,
|
||||
StringRef &Res) const {
|
||||
Res = EF.getDynamicString(toELFDynIter(Data)->getVal());
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
library_iterator ELFObjectFile<ELFT>::needed_library_end() const {
|
||||
return library_iterator(LibraryRef(toDRI(EF.end_dynamic_table()), this));
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
uint8_t ELFObjectFile<ELFT>::getBytesInAddress() const {
|
||||
return ELFT::Is64Bits ? 8 : 4;
|
||||
|
@ -118,11 +118,6 @@ public:
|
||||
std::error_code getRelocationHidden(DataRefImpl Rel,
|
||||
bool &Result) const override;
|
||||
|
||||
std::error_code getLibraryNext(DataRefImpl LibData,
|
||||
LibraryRef &Res) const override;
|
||||
std::error_code getLibraryPath(DataRefImpl LibData,
|
||||
StringRef &Res) const override;
|
||||
|
||||
// MachO specific.
|
||||
std::error_code getLibraryShortNameByIndex(unsigned Index, StringRef &Res);
|
||||
|
||||
@ -138,9 +133,6 @@ public:
|
||||
section_iterator section_begin() const override;
|
||||
section_iterator section_end() const override;
|
||||
|
||||
library_iterator needed_library_begin() const override;
|
||||
library_iterator needed_library_end() const override;
|
||||
|
||||
uint8_t getBytesInAddress() const override;
|
||||
|
||||
StringRef getFileFormatName() const override;
|
||||
|
@ -178,30 +178,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// LibraryRef - This is a value type class that represents a single library in
|
||||
/// the list of libraries needed by a shared or dynamic object.
|
||||
class LibraryRef {
|
||||
friend class SectionRef;
|
||||
DataRefImpl LibraryPimpl;
|
||||
const ObjectFile *OwningObject;
|
||||
|
||||
public:
|
||||
LibraryRef() : OwningObject(nullptr) { }
|
||||
|
||||
LibraryRef(DataRefImpl LibraryP, const ObjectFile *Owner);
|
||||
|
||||
bool operator==(const LibraryRef &Other) const;
|
||||
bool operator<(const LibraryRef &Other) const;
|
||||
|
||||
std::error_code getNext(LibraryRef &Result) const;
|
||||
|
||||
// Get the path to this library, as stored in the object file.
|
||||
std::error_code getPath(StringRef &Result) const;
|
||||
|
||||
DataRefImpl getRawDataRefImpl() const;
|
||||
};
|
||||
typedef content_iterator<LibraryRef> library_iterator;
|
||||
|
||||
/// ObjectFile - This class is the base class for all object file types.
|
||||
/// Concrete instances of this object are created by createObjectFile, which
|
||||
/// figures out which type to create.
|
||||
@ -299,13 +275,6 @@ protected:
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
// Same for LibraryRef
|
||||
friend class LibraryRef;
|
||||
virtual std::error_code getLibraryNext(DataRefImpl Lib,
|
||||
LibraryRef &Res) const = 0;
|
||||
virtual std::error_code getLibraryPath(DataRefImpl Lib,
|
||||
StringRef &Res) const = 0;
|
||||
|
||||
public:
|
||||
typedef iterator_range<symbol_iterator> symbol_iterator_range;
|
||||
symbol_iterator_range symbols() const {
|
||||
@ -320,9 +289,6 @@ public:
|
||||
return section_iterator_range(section_begin(), section_end());
|
||||
}
|
||||
|
||||
virtual library_iterator needed_library_begin() const = 0;
|
||||
virtual library_iterator needed_library_end() const = 0;
|
||||
|
||||
/// @brief The number of bytes used to represent an address in this object
|
||||
/// file format.
|
||||
virtual uint8_t getBytesInAddress() const = 0;
|
||||
@ -549,26 +515,6 @@ inline const ObjectFile *RelocationRef::getObjectFile() const {
|
||||
return OwningObject;
|
||||
}
|
||||
|
||||
// Inline function definitions.
|
||||
inline LibraryRef::LibraryRef(DataRefImpl LibraryP, const ObjectFile *Owner)
|
||||
: LibraryPimpl(LibraryP)
|
||||
, OwningObject(Owner) {}
|
||||
|
||||
inline bool LibraryRef::operator==(const LibraryRef &Other) const {
|
||||
return LibraryPimpl == Other.LibraryPimpl;
|
||||
}
|
||||
|
||||
inline bool LibraryRef::operator<(const LibraryRef &Other) const {
|
||||
return LibraryPimpl < Other.LibraryPimpl;
|
||||
}
|
||||
|
||||
inline std::error_code LibraryRef::getNext(LibraryRef &Result) const {
|
||||
return OwningObject->getLibraryNext(LibraryPimpl, Result);
|
||||
}
|
||||
|
||||
inline std::error_code LibraryRef::getPath(StringRef &Result) const {
|
||||
return OwningObject->getLibraryPath(LibraryPimpl, Result);
|
||||
}
|
||||
|
||||
} // end namespace object
|
||||
} // end namespace llvm
|
||||
|
@ -610,16 +610,6 @@ basic_symbol_iterator COFFObjectFile::symbol_end_impl() const {
|
||||
return basic_symbol_iterator(SymbolRef(Ret, this));
|
||||
}
|
||||
|
||||
library_iterator COFFObjectFile::needed_library_begin() const {
|
||||
// TODO: implement
|
||||
report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
|
||||
}
|
||||
|
||||
library_iterator COFFObjectFile::needed_library_end() const {
|
||||
// TODO: implement
|
||||
report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
|
||||
}
|
||||
|
||||
import_directory_iterator COFFObjectFile::import_directory_begin() const {
|
||||
return import_directory_iterator(
|
||||
ImportDirectoryEntryRef(ImportDirectory, 0, this));
|
||||
@ -989,16 +979,6 @@ COFFObjectFile::getRelocationValueString(DataRefImpl Rel,
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
std::error_code COFFObjectFile::getLibraryNext(DataRefImpl LibData,
|
||||
LibraryRef &Result) const {
|
||||
report_fatal_error("getLibraryNext not implemented in COFFObjectFile");
|
||||
}
|
||||
|
||||
std::error_code COFFObjectFile::getLibraryPath(DataRefImpl LibData,
|
||||
StringRef &Result) const {
|
||||
report_fatal_error("getLibraryPath not implemented in COFFObjectFile");
|
||||
}
|
||||
|
||||
bool ImportDirectoryEntryRef::
|
||||
operator==(const ImportDirectoryEntryRef &Other) const {
|
||||
return ImportTable == Other.ImportTable && Index == Other.Index;
|
||||
|
@ -1009,16 +1009,6 @@ std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel,
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getLibraryNext(DataRefImpl LibData,
|
||||
LibraryRef &Res) const {
|
||||
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getLibraryPath(DataRefImpl LibData,
|
||||
StringRef &Res) const {
|
||||
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
|
||||
}
|
||||
|
||||
//
|
||||
// guessLibraryShortName() is passed a name of a dynamic library and returns a
|
||||
// guess on what the short name is. Then name is returned as a substring of the
|
||||
@ -1246,16 +1236,6 @@ section_iterator MachOObjectFile::section_end() const {
|
||||
return section_iterator(SectionRef(DRI, this));
|
||||
}
|
||||
|
||||
library_iterator MachOObjectFile::needed_library_begin() const {
|
||||
// TODO: implement
|
||||
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
|
||||
}
|
||||
|
||||
library_iterator MachOObjectFile::needed_library_end() const {
|
||||
// TODO: implement
|
||||
report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
|
||||
}
|
||||
|
||||
uint8_t MachOObjectFile::getBytesInAddress() const {
|
||||
return is64Bit() ? 8 : 4;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user