[llvm] ad0da31 - [NFC] Reformat llvm-elfabi

Haowei Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 10:42:02 PST 2020


Author: Haowei Wu
Date: 2020-11-11T10:41:51-08:00
New Revision: ad0da312c05d5264fac71dfe417d8a1e117b6a43

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

LOG: [NFC] Reformat llvm-elfabi

Makes diff in next commit more readable.

Added: 
    

Modified: 
    llvm/tools/llvm-elfabi/ErrorCollector.cpp
    llvm/tools/llvm-elfabi/llvm-elfabi.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-elfabi/ErrorCollector.cpp b/llvm/tools/llvm-elfabi/ErrorCollector.cpp
index debb55eeb7fc..a52aeff8266b 100644
--- a/llvm/tools/llvm-elfabi/ErrorCollector.cpp
+++ b/llvm/tools/llvm-elfabi/ErrorCollector.cpp
@@ -16,9 +16,7 @@
 using namespace llvm;
 using namespace llvm::elfabi;
 
-void ErrorCollector::escalateToFatal() {
-  ErrorsAreFatal = true;
-}
+void ErrorCollector::escalateToFatal() { ErrorsAreFatal = true; }
 
 void ErrorCollector::addError(Error &&Err, StringRef Tag) {
   if (Err) {
@@ -48,9 +46,7 @@ void ErrorCollector::log(raw_ostream &OS) {
   }
 }
 
-bool ErrorCollector::allErrorsHandled() const {
-  return Errors.empty();
-}
+bool ErrorCollector::allErrorsHandled() const { return Errors.empty(); }
 
 ErrorCollector::~ErrorCollector() {
   if (ErrorsAreFatal && !allErrorsHandled())

diff  --git a/llvm/tools/llvm-elfabi/llvm-elfabi.cpp b/llvm/tools/llvm-elfabi/llvm-elfabi.cpp
index 8bf2ad4ed537..4e34de845851 100644
--- a/llvm/tools/llvm-elfabi/llvm-elfabi.cpp
+++ b/llvm/tools/llvm-elfabi/llvm-elfabi.cpp
@@ -21,10 +21,7 @@
 namespace llvm {
 namespace elfabi {
 
-enum class FileFormat {
-  TBE,
-  ELF
-};
+enum class FileFormat { TBE, ELF };
 
 } // end namespace elfabi
 } // end namespace llvm
@@ -35,20 +32,20 @@ using namespace llvm::elfabi;
 // Command line flags:
 cl::opt<FileFormat> InputFileFormat(
     cl::desc("Force input file format:"),
-    cl::values(clEnumValN(FileFormat::TBE,
-                          "tbe", "Read `input` as text-based ELF stub"),
-               clEnumValN(FileFormat::ELF,
-                          "elf", "Read `input` as ELF binary")));
+    cl::values(clEnumValN(FileFormat::TBE, "tbe",
+                          "Read `input` as text-based ELF stub"),
+               clEnumValN(FileFormat::ELF, "elf",
+                          "Read `input` as ELF binary")));
 cl::opt<std::string> InputFilePath(cl::Positional, cl::desc("input"),
                                    cl::Required);
 cl::opt<std::string>
     EmitTBE("emit-tbe",
             cl::desc("Emit a text-based ELF stub (.tbe) from the input file"),
             cl::value_desc("path"));
-cl::opt<std::string> SOName(
-    "soname",
-    cl::desc("Manually set the DT_SONAME entry of any emitted files"),
-    cl::value_desc("name"));
+cl::opt<std::string>
+    SOName("soname",
+           cl::desc("Manually set the DT_SONAME entry of any emitted files"),
+           cl::value_desc("name"));
 
 /// writeTBE() writes a Text-Based ELF stub to a file using the latest version
 /// of the YAML parser.


        


More information about the llvm-commits mailing list