From 0aa87fa84f377fa43e1df98584fe31813c33caeb Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 24 Feb 2025 08:42:59 -0800 Subject: [PATCH] simplify Created using spr 1.3.4 --- llvm/tools/llvm-size/llvm-size.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp index a408236752945..afb6b2386218e 100644 --- a/llvm/tools/llvm-size/llvm-size.cpp +++ b/llvm/tools/llvm-size/llvm-size.cpp @@ -76,7 +76,7 @@ static std::vector ArchFlags; static bool ELFCommons; static OutputFormatTy OutputFormat; static bool DarwinLongFormat; -static RadixTy Radix; +static RadixTy Radix = RadixTy::decimal; static bool TotalSizes; static std::vector InputFilenames; @@ -899,10 +899,8 @@ int llvm_size_main(int argc, char **argv, const llvm::ToolContext &) { OutputFormat = darwin; else if (V == "sysv") OutputFormat = sysv; - else { + else error("--format value should be one of: 'berkeley', 'darwin', 'sysv'"); - OutputFormat = berkeley; - } V = Args.getLastArgValue(OPT_radix_EQ, "10"); if (V == "8") Radix = RadixTy::octal; @@ -910,10 +908,8 @@ int llvm_size_main(int argc, char **argv, const llvm::ToolContext &) { Radix = RadixTy::decimal; else if (V == "16") Radix = RadixTy::hexadecimal; - else { + else error("--radix value should be one of: 8, 10, 16 "); - Radix = RadixTy::decimal; - } for (const auto *A : Args.filtered(OPT_arch_EQ)) { SmallVector Values;