[llvm] b21f32f - [llvm-readelf] - Add explicit braces again. NFC.

Georgii Rymar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 03:10:42 PDT 2020


Author: Georgii Rymar
Date: 2020-06-01T13:10:16+03:00
New Revision: b21f32fcecd012fa2c2f8c61d7259079a7f1865e

URL: https://github.com/llvm/llvm-project/commit/b21f32fcecd012fa2c2f8c61d7259079a7f1865e
DIFF: https://github.com/llvm/llvm-project/commit/b21f32fcecd012fa2c2f8c61d7259079a7f1865e.diff

LOG: [llvm-readelf] - Add explicit braces again. NFC.

Partially reverts feee98645dde4be31a70cc6660d2fc4d4b9d32d8.

Add explicit braces to a different place to fix
"error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]"

Added: 
    

Modified: 
    llvm/tools/llvm-readobj/ELFDumper.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index dc413accb287..2c9a4b9c4900 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -4702,20 +4702,19 @@ void GNUStyle<ELFT>::printGnuHashHistogram(const Elf_GnuHash &GnuHashTable) {
 template <class ELFT>
 void GNUStyle<ELFT>::printHashHistograms(const ELFFile<ELFT> *Obj) {
   // Print histogram for the .hash section.
-  if (const Elf_Hash *HashTable = this->dumper()->getHashTable())
-    if (Error E = checkHashTable<ELFT>(Obj, HashTable)) {
+  if (const Elf_Hash *HashTable = this->dumper()->getHashTable()) {
+    if (Error E = checkHashTable<ELFT>(Obj, HashTable))
       this->reportUniqueWarning(std::move(E));
-    } else {
+    else
       printHashHistogram(*HashTable);
-    }
+  }
 
   // Print histogram for the .gnu.hash section.
   if (const Elf_GnuHash *GnuHashTable = this->dumper()->getGnuHashTable()) {
-    if (Error E = checkGNUHashTable<ELFT>(Obj, GnuHashTable)) {
+    if (Error E = checkGNUHashTable<ELFT>(Obj, GnuHashTable))
       this->reportUniqueWarning(std::move(E));
-    } else {
+    else
       printGnuHashHistogram(*GnuHashTable);
-    }
   }
 }
 


        


More information about the llvm-commits mailing list