Delete UnknownAddress. It is a perfectly valid symbol value.
getSymbolValue now returns a value that in convenient for most callers: * 0 for undefined * symbol size for common symbols * offset/address for symbols the rest Code that needs something more specific can check getSymbolFlags. llvm-svn: 241605
This commit is contained in:
@@ -35,6 +35,15 @@ bool SectionRef::containsSymbol(SymbolRef S) const {
|
||||
return *this == *SymSec;
|
||||
}
|
||||
|
||||
uint64_t ObjectFile::getSymbolValue(DataRefImpl Ref) const {
|
||||
uint32_t Flags = getSymbolFlags(Ref);
|
||||
if (Flags & SymbolRef::SF_Undefined)
|
||||
return 0;
|
||||
if (Flags & SymbolRef::SF_Common)
|
||||
return getCommonSymbolSize(Ref);
|
||||
return getSymbolValueImpl(Ref);
|
||||
}
|
||||
|
||||
std::error_code ObjectFile::printSymbolName(raw_ostream &OS,
|
||||
DataRefImpl Symb) const {
|
||||
ErrorOr<StringRef> Name = getSymbolName(Symb);
|
||||
|
||||
Reference in New Issue
Block a user