[llvm] r259937 - [llvm-nm] Transform a switch() statement in a pair of if(s).

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 14:07:09 PST 2016


Author: davide
Date: Fri Feb  5 16:07:09 2016
New Revision: 259937

URL: http://llvm.org/viewvc/llvm-project?rev=259937&view=rev
Log:
[llvm-nm] Transform a switch() statement in a pair of if(s).

This is more uniform wrt what other tools do and makes the code
a little bit more readable.

Modified:
    llvm/trunk/tools/llvm-nm/llvm-nm.cpp

Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=259937&r1=259936&r2=259937&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Fri Feb  5 16:07:09 2016
@@ -1267,15 +1267,10 @@ int main(int argc, char **argv) {
     PrintAddress = false;
   if (OutputFormat == sysv || SizeSort)
     PrintSize = true;
-
-  switch (InputFilenames.size()) {
-  case 0:
+  if (InputFilenames.size() == 0)
     InputFilenames.push_back("a.out");
-  case 1:
-    break;
-  default:
+  if (InputFilenames.size() > 1)
     MultipleFiles = true;
-  }
 
   for (unsigned i = 0; i < ArchFlags.size(); ++i) {
     if (ArchFlags[i] == "all") {




More information about the llvm-commits mailing list