[llvm] r185691 - Remove NoOperation.

Rafael Espindola rafael.espindola at gmail.com
Fri Jul 5 05:12:43 PDT 2013


Author: rafael
Date: Fri Jul  5 07:12:43 2013
New Revision: 185691

URL: http://llvm.org/viewvc/llvm-project?rev=185691&view=rev
Log:
Remove NoOperation.

parseCommandLine prints and error and exists if no operation is specified, so
it never returns NoOperation.

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

Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=185691&r1=185690&r2=185691&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Fri Jul  5 07:12:43 2013
@@ -83,7 +83,6 @@ static cl::extrahelp MoreHelp(
 // This enumeration delineates the kinds of operations on an archive
 // that are permitted.
 enum ArchiveOperation {
-  NoOperation,      ///< An operation hasn't been specified
   Print,            ///< Print the contents of the archive
   Delete,           ///< Delete the specified members
   Move,             ///< Move members to end or as given by {a,b,i} modifiers
@@ -205,7 +204,7 @@ ArchiveOperation parseCommandLine() {
   unsigned NumPositional = 0;
 
   // Keep track of which operation was requested
-  ArchiveOperation Operation = NoOperation;
+  ArchiveOperation Operation;
 
   for(unsigned i=0; i<Options.size(); ++i) {
     switch(Options[i]) {
@@ -697,9 +696,6 @@ int main(int argc, char **argv) {
     case ReplaceOrInsert: haveError = doReplaceOrInsert(&ErrMsg); break;
     case DisplayTable:    haveError = doDisplayTable(&ErrMsg); break;
     case Extract:         haveError = doExtract(&ErrMsg); break;
-    case NoOperation:
-      errs() << argv[0] << ": No operation was selected.\n";
-      break;
   }
   if (haveError) {
     errs() << argv[0] << ": " << ErrMsg << "\n";





More information about the llvm-commits mailing list