mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Add interface for querying object files for symbol values.
Currently only implemented for ELF. Patch by Amara Emerson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -234,6 +234,9 @@ public:
|
||||
/// end_sections() if it is undefined or is an absolute symbol.
|
||||
error_code getSection(section_iterator &Result) const;
|
||||
|
||||
/// @brief Get value of the symbol in the symbol table.
|
||||
error_code getValue(uint64_t &Val) const;
|
||||
|
||||
DataRefImpl getRawDataRefImpl() const;
|
||||
};
|
||||
typedef content_iterator<SymbolRef> symbol_iterator;
|
||||
@ -300,6 +303,7 @@ protected:
|
||||
uint32_t &Res) const = 0;
|
||||
virtual error_code getSymbolSection(DataRefImpl Symb,
|
||||
section_iterator &Res) const = 0;
|
||||
virtual error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const = 0;
|
||||
|
||||
// Same as above for SectionRef.
|
||||
friend class SectionRef;
|
||||
@ -444,6 +448,10 @@ inline error_code SymbolRef::getType(SymbolRef::Type &Result) const {
|
||||
return OwningObject->getSymbolType(SymbolPimpl, Result);
|
||||
}
|
||||
|
||||
inline error_code SymbolRef::getValue(uint64_t &Val) const {
|
||||
return OwningObject->getSymbolValue(SymbolPimpl, Val);
|
||||
}
|
||||
|
||||
inline DataRefImpl SymbolRef::getRawDataRefImpl() const {
|
||||
return SymbolPimpl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user