mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-15 12:09:51 +00:00
Move code to a helper function. NFC.
Part of a patch by Jake Ehrlich! llvm-svn: 314012
This commit is contained in:
parent
1788a9b71c
commit
d901deee6e
@ -277,6 +277,18 @@ static sys::TimePoint<std::chrono::seconds> now(bool Deterministic) {
|
||||
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.
|
||||
static Expected<unsigned>
|
||||
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()) {
|
||||
uint32_t Symflags = S.getFlags();
|
||||
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))
|
||||
if (!isArchiveSymbol(S))
|
||||
continue;
|
||||
|
||||
unsigned NameOffset = NameOS.tell();
|
||||
|
Loading…
Reference in New Issue
Block a user