diff --git a/include/llvm/ExecutionEngine/JITLink/JITLink.h b/include/llvm/ExecutionEngine/JITLink/JITLink.h index 7470cca4980..f70de776f06 100644 --- a/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ b/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -581,9 +581,6 @@ public: /// Return the number of symbols in this section. SymbolSet::size_type symbols_size() { return Symbols.size(); } - /// Return true if this section contains no symbols. - bool symbols_empty() const { return Symbols.empty(); } - private: void addSymbol(Symbol &Sym) { assert(!Symbols.count(&Sym) && "Symbol is already in this section"); @@ -618,7 +615,7 @@ class SectionRange { public: SectionRange() = default; SectionRange(const Section &Sec) { - if (Sec.symbols_empty()) + if (llvm::empty(Sec.symbols())) return; First = Last = *Sec.symbols().begin(); for (auto *Sym : Sec.symbols()) { diff --git a/tools/llvm-jitlink/llvm-jitlink-macho.cpp b/tools/llvm-jitlink/llvm-jitlink-macho.cpp index 9488dfe9b75..428e94bc3ff 100644 --- a/tools/llvm-jitlink/llvm-jitlink-macho.cpp +++ b/tools/llvm-jitlink/llvm-jitlink-macho.cpp @@ -90,12 +90,12 @@ Error registerMachOStubsAndGOT(Session &S, LinkGraph &G) { for (auto &Sec : G.sections()) { LLVM_DEBUG({ dbgs() << " Section \"" << Sec.getName() << "\": " - << (Sec.symbols_empty() ? "empty. skipping." : "processing...") + << (llvm::empty(Sec.symbols()) ? "empty. skipping." : "processing...") << "\n"; }); // Skip empty sections. - if (Sec.symbols_empty()) + if (llvm::empty(Sec.symbols())) continue; if (FileInfo.SectionInfos.count(Sec.getName())) diff --git a/tools/llvm-jitlink/llvm-jitlink.cpp b/tools/llvm-jitlink/llvm-jitlink.cpp index f5b841811cb..de52bb9ec63 100644 --- a/tools/llvm-jitlink/llvm-jitlink.cpp +++ b/tools/llvm-jitlink/llvm-jitlink.cpp @@ -174,11 +174,11 @@ static void dumpSectionContents(raw_ostream &OS, LinkGraph &G) { std::sort(Sections.begin(), Sections.end(), [](const Section *LHS, const Section *RHS) { - if (LHS->symbols_empty() && RHS->symbols_empty()) + if (llvm::empty(LHS->symbols()) && llvm::empty(RHS->symbols())) return false; - if (LHS->symbols_empty()) + if (llvm::empty(LHS->symbols())) return false; - if (RHS->symbols_empty()) + if (llvm::empty(RHS->symbols())) return true; SectionRange LHSRange(*LHS); SectionRange RHSRange(*RHS); @@ -187,7 +187,7 @@ static void dumpSectionContents(raw_ostream &OS, LinkGraph &G) { for (auto *S : Sections) { OS << S->getName() << " content:"; - if (S->symbols_empty()) { + if (llvm::empty(S->symbols())) { OS << "\n section empty\n"; continue; }