[llvm] 105ddd0 - [NFC] Remove dead code (try 2)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 22 16:15:08 PST 2022
Author: Arthur Eubanks
Date: 2022-02-22T16:15:01-08:00
New Revision: 105ddd0fdca0e585db6be05ee8f4a1941d113ca2
URL: https://github.com/llvm/llvm-project/commit/105ddd0fdca0e585db6be05ee8f4a1941d113ca2
DIFF: https://github.com/llvm/llvm-project/commit/105ddd0fdca0e585db6be05ee8f4a1941d113ca2.diff
LOG: [NFC] Remove dead code (try 2)
This is causing
../../llvm/include/llvm/Object/MachO.h:379:13: warning: private field 'Kind' is not used [-Wunused-private-field]
FixupKind Kind;
Previous attempt in a23f7c0cb6b42a06bc9707fdf46ce2a90080f61f.
Added:
Modified:
llvm/include/llvm/Object/MachO.h
llvm/lib/Object/MachOObjectFile.cpp
llvm/tools/llvm-objdump/MachODump.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h
index 3350e8215ff9f..de911c005b53d 100644
--- a/llvm/include/llvm/Object/MachO.h
+++ b/llvm/include/llvm/Object/MachO.h
@@ -364,8 +364,7 @@ class MachOChainedFixupEntry : public MachOAbstractFixupEntry {
public:
enum class FixupKind { All, Bind, WeakBind, Rebase };
- MachOChainedFixupEntry(Error *Err, const MachOObjectFile *O, FixupKind Kind,
- bool Parse);
+ MachOChainedFixupEntry(Error *Err, const MachOObjectFile *O, bool Parse);
bool operator==(const MachOChainedFixupEntry &) const;
@@ -376,7 +375,6 @@ class MachOChainedFixupEntry : public MachOAbstractFixupEntry {
private:
std::vector<ChainedFixupTarget> FixupTargets;
uint32_t FixupIndex = 0;
- FixupKind Kind;
};
using fixup_iterator = content_iterator<MachOChainedFixupEntry>;
@@ -523,8 +521,7 @@ class MachOObjectFile : public ObjectFile {
iterator_range<bind_iterator> bindTable(Error &Err);
/// For iterating over all chained fixups.
- iterator_range<fixup_iterator>
- fixupTable(Error &Err, MachOChainedFixupEntry::FixupKind Kind);
+ iterator_range<fixup_iterator> fixupTable(Error &Err);
/// For use iterating over all lazy bind table entries.
iterator_range<bind_iterator> lazyBindTable(Error &Err);
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 051055173d3f1..5d6e237c8a99a 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -3256,8 +3256,8 @@ void MachOAbstractFixupEntry::moveToEnd() { Done = true; }
MachOChainedFixupEntry::MachOChainedFixupEntry(Error *E,
const MachOObjectFile *O,
- FixupKind Kind, bool Parse)
- : MachOAbstractFixupEntry(E, O), Kind(Kind) {
+ bool Parse)
+ : MachOAbstractFixupEntry(E, O) {
ErrorAsOutParameter e(E);
if (Parse) {
if (auto FixupTargetsOrErr = O->getDyldChainedFixupTargets())
@@ -4298,13 +4298,11 @@ iterator_range<bind_iterator> MachOObjectFile::weakBindTable(Error &Err) {
MachOBindEntry::Kind::Weak);
}
-iterator_range<fixup_iterator>
-MachOObjectFile::fixupTable(Error &Err,
- MachOChainedFixupEntry::FixupKind Kind) {
- MachOChainedFixupEntry Start(&Err, this, Kind, true);
+iterator_range<fixup_iterator> MachOObjectFile::fixupTable(Error &Err) {
+ MachOChainedFixupEntry Start(&Err, this, true);
Start.moveToFirst();
- MachOChainedFixupEntry Finish(&Err, this, Kind, false);
+ MachOChainedFixupEntry Finish(&Err, this, false);
Finish.moveToEnd();
return make_range(fixup_iterator(Start), fixup_iterator(Finish));
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 88731e828598b..4ec555ecf3a30 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -1184,11 +1184,9 @@ static void PrintLinkOptHints(MachOObjectFile *O) {
}
}
-static void printMachOChainedFixups(object::MachOObjectFile *Obj,
- MachOChainedFixupEntry::FixupKind Type) {
+static void printMachOChainedFixups(object::MachOObjectFile *Obj) {
Error Err = Error::success();
- for (const object::MachOChainedFixupEntry &Entry :
- Obj->fixupTable(Err, Type)) {
+ for (const object::MachOChainedFixupEntry &Entry : Obj->fixupTable(Err)) {
(void)Entry;
}
if (Err)
@@ -1197,7 +1195,7 @@ static void printMachOChainedFixups(object::MachOObjectFile *Obj,
static void PrintDyldInfo(MachOObjectFile *O) {
outs() << "dyld information:" << '\n';
- printMachOChainedFixups(O, MachOChainedFixupEntry::FixupKind::Bind);
+ printMachOChainedFixups(O);
}
static void PrintDylibs(MachOObjectFile *O, bool JustId) {
More information about the llvm-commits
mailing list