[llvm] 8c4f048 - [JITLink] Remove the Section::symbols_empty() method.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 20:20:16 PST 2019
Author: Lang Hames
Date: 2019-12-05T20:19:17-08:00
New Revision: 8c4f048a00065d5cc2e138fba17abf74f2ae873d
URL: https://github.com/llvm/llvm-project/commit/8c4f048a00065d5cc2e138fba17abf74f2ae873d
DIFF: https://github.com/llvm/llvm-project/commit/8c4f048a00065d5cc2e138fba17abf74f2ae873d.diff
LOG: [JITLink] Remove the Section::symbols_empty() method.
llvm::empty(Sec.symbols()) can be used instead.
Added:
Modified:
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index 7470cca49806..f70de776f065 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -581,9 +581,6 @@ class Section {
/// 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/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
index 9488dfe9b75d..428e94bc3ffa 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
+++ b/llvm/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/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index f5b841811cb0..de52bb9ec637 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/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;
}
More information about the llvm-commits
mailing list