mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-13 11:30:21 +00:00
Move code to a helper function. NFC.
Part of a patch by Jake Ehrlich! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d3fa505559
commit
0cbbfe2ecf
@ -277,6 +277,18 @@ static sys::TimePoint<std::chrono::seconds> now(bool Deterministic) {
|
|||||||
return sys::TimePoint<seconds>();
|
return sys::TimePoint<seconds>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isArchiveSymbol(const object::BasicSymbolRef &S) {
|
||||||
|
uint32_t Symflags = S.getFlags();
|
||||||
|
if (Symflags & object::SymbolRef::SF_FormatSpecific)
|
||||||
|
return false;
|
||||||
|
if (!(Symflags & object::SymbolRef::SF_Global))
|
||||||
|
return false;
|
||||||
|
if (Symflags & object::SymbolRef::SF_Undefined &&
|
||||||
|
!(Symflags & object::SymbolRef::SF_Indirect))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the offset of the first reference to a member offset.
|
// Returns the offset of the first reference to a member offset.
|
||||||
static Expected<unsigned>
|
static Expected<unsigned>
|
||||||
writeSymbolTable(raw_fd_ostream &Out, object::Archive::Kind Kind,
|
writeSymbolTable(raw_fd_ostream &Out, object::Archive::Kind Kind,
|
||||||
@ -310,13 +322,7 @@ writeSymbolTable(raw_fd_ostream &Out, object::Archive::Kind Kind,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const object::BasicSymbolRef &S : Obj.symbols()) {
|
for (const object::BasicSymbolRef &S : Obj.symbols()) {
|
||||||
uint32_t Symflags = S.getFlags();
|
if (!isArchiveSymbol(S))
|
||||||
if (Symflags & object::SymbolRef::SF_FormatSpecific)
|
|
||||||
continue;
|
|
||||||
if (!(Symflags & object::SymbolRef::SF_Global))
|
|
||||||
continue;
|
|
||||||
if (Symflags & object::SymbolRef::SF_Undefined &&
|
|
||||||
!(Symflags & object::SymbolRef::SF_Indirect))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
unsigned NameOffset = NameOS.tell();
|
unsigned NameOffset = NameOS.tell();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user