Skip to content

Commit 8c4f048

Browse files
committed
[JITLink] Remove the Section::symbols_empty() method.
llvm::empty(Sec.symbols()) can be used instead.
1 parent 560ab1f commit 8c4f048

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,6 @@ class Section {
581581
/// Return the number of symbols in this section.
582582
SymbolSet::size_type symbols_size() { return Symbols.size(); }
583583

584-
/// Return true if this section contains no symbols.
585-
bool symbols_empty() const { return Symbols.empty(); }
586-
587584
private:
588585
void addSymbol(Symbol &Sym) {
589586
assert(!Symbols.count(&Sym) && "Symbol is already in this section");
@@ -618,7 +615,7 @@ class SectionRange {
618615
public:
619616
SectionRange() = default;
620617
SectionRange(const Section &Sec) {
621-
if (Sec.symbols_empty())
618+
if (llvm::empty(Sec.symbols()))
622619
return;
623620
First = Last = *Sec.symbols().begin();
624621
for (auto *Sym : Sec.symbols()) {

llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ Error registerMachOStubsAndGOT(Session &S, LinkGraph &G) {
9090
for (auto &Sec : G.sections()) {
9191
LLVM_DEBUG({
9292
dbgs() << " Section \"" << Sec.getName() << "\": "
93-
<< (Sec.symbols_empty() ? "empty. skipping." : "processing...")
93+
<< (llvm::empty(Sec.symbols()) ? "empty. skipping." : "processing...")
9494
<< "\n";
9595
});
9696

9797
// Skip empty sections.
98-
if (Sec.symbols_empty())
98+
if (llvm::empty(Sec.symbols()))
9999
continue;
100100

101101
if (FileInfo.SectionInfos.count(Sec.getName()))

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ static void dumpSectionContents(raw_ostream &OS, LinkGraph &G) {
174174

175175
std::sort(Sections.begin(), Sections.end(),
176176
[](const Section *LHS, const Section *RHS) {
177-
if (LHS->symbols_empty() && RHS->symbols_empty())
177+
if (llvm::empty(LHS->symbols()) && llvm::empty(RHS->symbols()))
178178
return false;
179-
if (LHS->symbols_empty())
179+
if (llvm::empty(LHS->symbols()))
180180
return false;
181-
if (RHS->symbols_empty())
181+
if (llvm::empty(RHS->symbols()))
182182
return true;
183183
SectionRange LHSRange(*LHS);
184184
SectionRange RHSRange(*RHS);
@@ -187,7 +187,7 @@ static void dumpSectionContents(raw_ostream &OS, LinkGraph &G) {
187187

188188
for (auto *S : Sections) {
189189
OS << S->getName() << " content:";
190-
if (S->symbols_empty()) {
190+
if (llvm::empty(S->symbols())) {
191191
OS << "\n section empty\n";
192192
continue;
193193
}

0 commit comments

Comments
 (0)