mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[llvm-objdump] Use auto
declaration in typecasting
Summary: According to `MaskRay`, use `auto` for type inference, according to coding standards. Delete some comments, because these comments can be easily inferred from codes. Reviewers: jhenderson, MaskRay Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54573 llvm-svn: 346946
This commit is contained in:
parent
8370d4e073
commit
5672b55a7b
@ -158,31 +158,23 @@ template <class ELFT> void printProgramHeaders(const ELFFile<ELFT> *o) {
|
||||
}
|
||||
|
||||
void llvm::printELFFileHeader(const object::ObjectFile *Obj) {
|
||||
// Little-endian 32-bit
|
||||
if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
|
||||
if (const auto *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
|
||||
printProgramHeaders(ELFObj->getELFFile());
|
||||
// Big-endian 32-bit
|
||||
else if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
|
||||
printProgramHeaders(ELFObj->getELFFile());
|
||||
// Little-endian 64-bit
|
||||
else if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
|
||||
printProgramHeaders(ELFObj->getELFFile());
|
||||
// Big-endian 64-bit
|
||||
else if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
|
||||
printProgramHeaders(ELFObj->getELFFile());
|
||||
}
|
||||
|
||||
void llvm::printELFDynamicSection(const object::ObjectFile *Obj) {
|
||||
// Little-endian 32-bit
|
||||
if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
|
||||
if (const auto *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
|
||||
printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
|
||||
// Big-endian 32-bit
|
||||
else if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
|
||||
printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
|
||||
// Little-endian 64-bit
|
||||
else if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
|
||||
printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
|
||||
// Big-endian 64-bit
|
||||
else if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
|
||||
else if (const auto *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
|
||||
printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user