mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-18 13:16:24 -04:00
[llvm-objdump] - Cleanup the code. NFCI.
This is a cosmetic cleanup for the llvm-objdump code. This patch: * Renames things to match the official LLVM code style (lower case -> upper case). * Removes few obviously excessive variables. * Moves a few lines closer to the place of use, reorders the code a bit to simplify it, to avoid doing excessive returns and to avoid using 'else` after returns. I focused only on a llvm-objdump.h/llvm-objdump.cpp files. Few changes in the MachODump.cpp and COFFDump.cpp are a result of llvm-objdump.h modification. Differential revision: https://reviews.llvm.org/D56637 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -455,7 +455,7 @@ static bool getPDataSection(const COFFObjectFile *Obj,
|
||||
Rels.push_back(Reloc);
|
||||
|
||||
// Sort relocations by address.
|
||||
llvm::sort(Rels, RelocAddressLess);
|
||||
llvm::sort(Rels, isRelocAddressLess);
|
||||
|
||||
ArrayRef<uint8_t> Contents;
|
||||
error(Obj->getSectionContents(Pdata, Contents));
|
||||
|
||||
@@ -1627,9 +1627,9 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
|
||||
if (Relocations)
|
||||
PrintRelocations(MachOOF, !NonVerbose);
|
||||
if (SectionHeaders)
|
||||
PrintSectionHeaders(MachOOF);
|
||||
printSectionHeaders(MachOOF);
|
||||
if (SectionContents)
|
||||
PrintSectionContents(MachOOF);
|
||||
printSectionContents(MachOOF);
|
||||
if (!FilterSections.empty())
|
||||
DumpSectionContents(FileName, MachOOF, !NonVerbose);
|
||||
if (InfoPlist)
|
||||
@@ -1639,7 +1639,7 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
|
||||
if (DylibId)
|
||||
PrintDylibs(MachOOF, true);
|
||||
if (SymbolTable)
|
||||
PrintSymbolTable(MachOOF, ArchiveName, ArchitectureName);
|
||||
printSymbolTable(MachOOF, ArchiveName, ArchitectureName);
|
||||
if (UnwindInfo)
|
||||
printMachOUnwindInfo(MachOOF);
|
||||
if (PrivateHeaders) {
|
||||
@@ -1959,7 +1959,7 @@ static bool ValidateArchFlags() {
|
||||
// -arch flags selecting just those slices as specified by them and also parses
|
||||
// archive files. Then for each individual Mach-O file ProcessMachO() is
|
||||
// called to process the file based on the command line options.
|
||||
void llvm::ParseInputMachO(StringRef Filename) {
|
||||
void llvm::parseInputMachO(StringRef Filename) {
|
||||
if (!ValidateArchFlags())
|
||||
return;
|
||||
|
||||
@@ -1998,7 +1998,7 @@ void llvm::ParseInputMachO(StringRef Filename) {
|
||||
return;
|
||||
}
|
||||
if (MachOUniversalBinary *UB = dyn_cast<MachOUniversalBinary>(&Bin)) {
|
||||
ParseInputMachO(UB);
|
||||
parseInputMachO(UB);
|
||||
return;
|
||||
}
|
||||
if (ObjectFile *O = dyn_cast<ObjectFile>(&Bin)) {
|
||||
@@ -2015,7 +2015,7 @@ void llvm::ParseInputMachO(StringRef Filename) {
|
||||
llvm_unreachable("Input object can't be invalid at this point");
|
||||
}
|
||||
|
||||
void llvm::ParseInputMachO(MachOUniversalBinary *UB) {
|
||||
void llvm::parseInputMachO(MachOUniversalBinary *UB) {
|
||||
if (!ValidateArchFlags())
|
||||
return;
|
||||
|
||||
|
||||
+250
-278
File diff suppressed because it is too large
Load Diff
@@ -70,35 +70,35 @@ extern cl::opt<DIDumpType> DwarfDumpType;
|
||||
|
||||
// Various helper functions.
|
||||
void error(std::error_code ec);
|
||||
bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
|
||||
void ParseInputMachO(StringRef Filename);
|
||||
void ParseInputMachO(object::MachOUniversalBinary *UB);
|
||||
void printCOFFUnwindInfo(const object::COFFObjectFile* o);
|
||||
void printMachOUnwindInfo(const object::MachOObjectFile* o);
|
||||
void printMachOExportsTrie(const object::MachOObjectFile* o);
|
||||
void printMachORebaseTable(object::MachOObjectFile* o);
|
||||
void printMachOBindTable(object::MachOObjectFile* o);
|
||||
void printMachOLazyBindTable(object::MachOObjectFile* o);
|
||||
void printMachOWeakBindTable(object::MachOObjectFile* o);
|
||||
void printELFFileHeader(const object::ObjectFile *o);
|
||||
bool isRelocAddressLess(object::RelocationRef A, object::RelocationRef B);
|
||||
void parseInputMachO(StringRef Filename);
|
||||
void parseInputMachO(object::MachOUniversalBinary *UB);
|
||||
void printCOFFUnwindInfo(const object::COFFObjectFile *O);
|
||||
void printMachOUnwindInfo(const object::MachOObjectFile *O);
|
||||
void printMachOExportsTrie(const object::MachOObjectFile *O);
|
||||
void printMachORebaseTable(object::MachOObjectFile *O);
|
||||
void printMachOBindTable(object::MachOObjectFile *O);
|
||||
void printMachOLazyBindTable(object::MachOObjectFile *O);
|
||||
void printMachOWeakBindTable(object::MachOObjectFile *O);
|
||||
void printELFFileHeader(const object::ObjectFile *O);
|
||||
void printELFDynamicSection(const object::ObjectFile *Obj);
|
||||
void printCOFFFileHeader(const object::ObjectFile *o);
|
||||
void printCOFFSymbolTable(const object::COFFImportFile *i);
|
||||
void printCOFFSymbolTable(const object::COFFObjectFile *o);
|
||||
void printMachOFileHeader(const object::ObjectFile *o);
|
||||
void printMachOLoadCommands(const object::ObjectFile *o);
|
||||
void printWasmFileHeader(const object::ObjectFile *o);
|
||||
void printExportsTrie(const object::ObjectFile *o);
|
||||
void printRebaseTable(object::ObjectFile *o);
|
||||
void printBindTable(object::ObjectFile *o);
|
||||
void printLazyBindTable(object::ObjectFile *o);
|
||||
void printWeakBindTable(object::ObjectFile *o);
|
||||
void printRawClangAST(const object::ObjectFile *o);
|
||||
void PrintRelocations(const object::ObjectFile *o);
|
||||
void PrintDynamicRelocations(const object::ObjectFile *o);
|
||||
void PrintSectionHeaders(const object::ObjectFile *o);
|
||||
void PrintSectionContents(const object::ObjectFile *o);
|
||||
void PrintSymbolTable(const object::ObjectFile *o, StringRef ArchiveName,
|
||||
void printCOFFFileHeader(const object::ObjectFile *O);
|
||||
void printCOFFSymbolTable(const object::COFFImportFile *I);
|
||||
void printCOFFSymbolTable(const object::COFFObjectFile *O);
|
||||
void printMachOFileHeader(const object::ObjectFile *O);
|
||||
void printMachOLoadCommands(const object::ObjectFile *O);
|
||||
void printWasmFileHeader(const object::ObjectFile *O);
|
||||
void printExportsTrie(const object::ObjectFile *O);
|
||||
void printRebaseTable(object::ObjectFile *O);
|
||||
void printBindTable(object::ObjectFile *O);
|
||||
void printLazyBindTable(object::ObjectFile *O);
|
||||
void printWeakBindTable(object::ObjectFile *O);
|
||||
void printRawClangAST(const object::ObjectFile *O);
|
||||
void printRelocations(const object::ObjectFile *O);
|
||||
void printDynamicRelocations(const object::ObjectFile *O);
|
||||
void printSectionHeaders(const object::ObjectFile *O);
|
||||
void printSectionContents(const object::ObjectFile *O);
|
||||
void printSymbolTable(const object::ObjectFile *O, StringRef ArchiveName,
|
||||
StringRef ArchitectureName = StringRef());
|
||||
void warn(StringRef Message);
|
||||
LLVM_ATTRIBUTE_NORETURN void error(Twine Message);
|
||||
|
||||
Reference in New Issue
Block a user