[llvm] feee986 - [llvm-readelf] - Add explicit braces. NFC.

Georgii Rymar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 02:55:37 PDT 2020


Author: Georgii Rymar
Date: 2020-06-01T12:55:24+03:00
New Revision: feee98645dde4be31a70cc6660d2fc4d4b9d32d8

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

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

Should fix the BB (http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/3907/steps/build%20stage%201/logs/stdio):

llvm-readobj/ELFDumper.cpp:4708:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    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 4b87067ce557..dc413accb287 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -4703,17 +4703,19 @@ 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 (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