[llvm] 29710c4 - [llvm-objdump] Prefer positive boolean Verbose instead of negative NonVerbose. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 10:16:09 PDT 2021
Author: Fangrui Song
Date: 2021-04-20T10:15:58-07:00
New Revision: 29710c4412cacb1cc51c25f85b9c7cde5ad137d3
URL: https://github.com/llvm/llvm-project/commit/29710c4412cacb1cc51c25f85b9c7cde5ad137d3
DIFF: https://github.com/llvm/llvm-project/commit/29710c4412cacb1cc51c25f85b9c7cde5ad137d3.diff
LOG: [llvm-objdump] Prefer positive boolean Verbose instead of negative NonVerbose. NFC
Differential Revision: https://reviews.llvm.org/D100791
Added:
Modified:
llvm/tools/llvm-objdump/MachODump.cpp
llvm/tools/llvm-objdump/MachODump.h
llvm/tools/llvm-objdump/llvm-objdump.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 170dcae90ae02..3574c45b31bcd 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -82,7 +82,7 @@ bool objdump::LinkOptHints;
bool objdump::InfoPlist;
bool objdump::DylibsUsed;
bool objdump::DylibId;
-bool objdump::NonVerbose;
+bool objdump::Verbose;
bool objdump::ObjcMetaData;
std::string objdump::DisSymName;
bool objdump::NoSymbolicOperands;
@@ -111,7 +111,7 @@ void objdump::parseMachOOptions(const llvm::opt::InputArgList &InputArgs) {
InfoPlist = InputArgs.hasArg(OBJDUMP_info_plist);
DylibsUsed = InputArgs.hasArg(OBJDUMP_dylibs_used);
DylibId = InputArgs.hasArg(OBJDUMP_dylib_id);
- NonVerbose = InputArgs.hasArg(OBJDUMP_non_verbose);
+ Verbose = !InputArgs.hasArg(OBJDUMP_non_verbose);
ObjcMetaData = InputArgs.hasArg(OBJDUMP_objc_meta_data);
DisSymName = InputArgs.getLastArgValue(OBJDUMP_dis_symname).str();
NoSymbolicOperands = InputArgs.hasArg(OBJDUMP_no_symbolic_operands);
@@ -1937,21 +1937,21 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
DisassembleMachO(FileName, MachOOF, "__TEXT", "__text");
}
if (IndirectSymbols)
- PrintIndirectSymbols(MachOOF, !NonVerbose);
+ PrintIndirectSymbols(MachOOF, Verbose);
if (DataInCode)
- PrintDataInCodeTable(MachOOF, !NonVerbose);
+ PrintDataInCodeTable(MachOOF, Verbose);
if (FunctionStarts)
PrintFunctionStarts(MachOOF);
if (LinkOptHints)
PrintLinkOptHints(MachOOF);
if (Relocations)
- PrintRelocations(MachOOF, !NonVerbose);
+ PrintRelocations(MachOOF, Verbose);
if (SectionHeaders)
printSectionHeaders(MachOOF);
if (SectionContents)
printSectionContents(MachOOF);
if (!FilterSections.empty())
- DumpSectionContents(FileName, MachOOF, !NonVerbose);
+ DumpSectionContents(FileName, MachOOF, Verbose);
if (InfoPlist)
DumpInfoPlistSectionContents(FileName, MachOOF);
if (DylibsUsed)
@@ -1969,7 +1969,7 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
if (FirstPrivateHeader)
printMachOFileHeader(MachOOF);
if (ObjcMetaData)
- printObjcMetaData(MachOOF, !NonVerbose);
+ printObjcMetaData(MachOOF, Verbose);
if (ExportsTrie)
printExportsTrie(MachOOF);
if (Rebase)
@@ -2308,7 +2308,7 @@ void objdump::parseInputMachO(StringRef Filename) {
if (Archive *A = dyn_cast<Archive>(&Bin)) {
outs() << "Archive : " << Filename << "\n";
if (ArchiveHeaders)
- printArchiveHeaders(Filename, A, !NonVerbose, ArchiveMemberOffsets);
+ printArchiveHeaders(Filename, A, Verbose, ArchiveMemberOffsets);
Error Err = Error::success();
unsigned I = -1;
@@ -2355,7 +2355,7 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) {
auto Filename = UB->getFileName();
if (UniversalHeaders)
- printMachOUniversalHeaders(UB, !NonVerbose);
+ printMachOUniversalHeaders(UB, Verbose);
// If we have a list of architecture flags specified dump only those.
if (!ArchAll && !ArchFlags.empty()) {
@@ -2389,7 +2389,7 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) {
outs() << " (architecture " << ArchitectureName << ")";
outs() << "\n";
if (ArchiveHeaders)
- printArchiveHeaders(Filename, A.get(), !NonVerbose,
+ printArchiveHeaders(Filename, A.get(), Verbose,
ArchiveMemberOffsets, ArchitectureName);
Error Err = Error::success();
unsigned I = -1;
@@ -2450,7 +2450,7 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) {
std::unique_ptr<Archive> &A = *AOrErr;
outs() << "Archive : " << Filename << "\n";
if (ArchiveHeaders)
- printArchiveHeaders(Filename, A.get(), !NonVerbose,
+ printArchiveHeaders(Filename, A.get(), Verbose,
ArchiveMemberOffsets);
Error Err = Error::success();
unsigned I = -1;
@@ -2503,8 +2503,8 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) {
outs() << " (architecture " << ArchitectureName << ")";
outs() << "\n";
if (ArchiveHeaders)
- printArchiveHeaders(Filename, A.get(), !NonVerbose,
- ArchiveMemberOffsets, ArchitectureName);
+ printArchiveHeaders(Filename, A.get(), Verbose, ArchiveMemberOffsets,
+ ArchitectureName);
Error Err = Error::success();
unsigned I = -1;
for (auto &C : A->children(Err)) {
@@ -10211,7 +10211,7 @@ static void PrintMachHeader(const MachOObjectFile *Obj, bool verbose) {
void objdump::printMachOFileHeader(const object::ObjectFile *Obj) {
const MachOObjectFile *file = dyn_cast<const MachOObjectFile>(Obj);
- PrintMachHeader(file, !NonVerbose);
+ PrintMachHeader(file, Verbose);
}
void objdump::printMachOLoadCommands(const object::ObjectFile *Obj) {
@@ -10229,7 +10229,7 @@ void objdump::printMachOLoadCommands(const object::ObjectFile *Obj) {
filetype = H.filetype;
cputype = H.cputype;
}
- PrintLoadCommands(file, filetype, cputype, !NonVerbose);
+ PrintLoadCommands(file, filetype, cputype, Verbose);
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/tools/llvm-objdump/MachODump.h b/llvm/tools/llvm-objdump/MachODump.h
index 70d8b80b36142..bfe3fd71c9542 100644
--- a/llvm/tools/llvm-objdump/MachODump.h
+++ b/llvm/tools/llvm-objdump/MachODump.h
@@ -48,7 +48,7 @@ extern bool LazyBind;
extern bool LinkOptHints;
extern bool NoLeadingHeaders;
extern bool NoSymbolicOperands;
-extern bool NonVerbose;
+extern bool Verbose;
extern bool ObjcMetaData;
extern std::string DisSymName;
extern bool Rebase;
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index e094468360202..186fce824b942 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2867,8 +2867,8 @@ static void parseOtoolOptions(const llvm::opt::InputArgList &InputArgs) {
}
if (InputArgs.hasArg(OTOOL_t))
FilterSections.push_back("__TEXT,__text");
- NonVerbose = !(InputArgs.hasArg(OTOOL_v) || InputArgs.hasArg(OTOOL_V) ||
- InputArgs.hasArg(OTOOL_o));
+ Verbose = (InputArgs.hasArg(OTOOL_v) || InputArgs.hasArg(OTOOL_V) ||
+ InputArgs.hasArg(OTOOL_o));
NoSymbolicOperands = !InputArgs.hasArg(OTOOL_V);
if (InputArgs.hasArg(OTOOL_x))
FilterSections.push_back(",__text");
More information about the llvm-commits
mailing list