[llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 27 15:10:43 PDT 2006



Changes in directory llvm/lib/Support:

CommandLine.cpp updated: 1.74 -> 1.75
---
Log message:

Minor code cleanups


---
Diffs of the changes:  (+10 -11)

 CommandLine.cpp |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)


Index: llvm/lib/Support/CommandLine.cpp
diff -u llvm/lib/Support/CommandLine.cpp:1.74 llvm/lib/Support/CommandLine.cpp:1.75
--- llvm/lib/Support/CommandLine.cpp:1.74	Sun Aug 27 07:45:47 2006
+++ llvm/lib/Support/CommandLine.cpp	Sun Aug 27 17:10:29 2006
@@ -214,8 +214,8 @@
 /// using strdup (), so it is the caller's responsibility to free ()
 /// them later.
 ///
-static void ParseCStringVector (std::vector<char *> &output,
-                                const char *input) {
+static void ParseCStringVector(std::vector<char *> &output,
+                               const char *input) {
   // Characters which will be treated as token separators:
   static const char *delims = " \v\f\t\r\n";
 
@@ -265,26 +265,25 @@
   assert(envVar && "Environment variable name missing");
 
   // Get the environment variable they want us to parse options out of.
-  const char *envValue = getenv (envVar);
+  const char *envValue = getenv(envVar);
   if (!envValue)
     return;
 
   // Get program's "name", which we wouldn't know without the caller
   // telling us.
-  std::vector<char *> newArgv;
-  newArgv.push_back (strdup (progName));
+  std::vector<char*> newArgv;
+  newArgv.push_back(strdup(progName));
 
   // Parse the value of the environment variable into a "command line"
   // and hand it off to ParseCommandLineOptions().
-  ParseCStringVector (newArgv, envValue);
-  int newArgc = newArgv.size ();
-  ParseCommandLineOptions (newArgc, &newArgv[0], Overview);
+  ParseCStringVector(newArgv, envValue);
+  int newArgc = newArgv.size();
+  ParseCommandLineOptions(newArgc, &newArgv[0], Overview);
 
   // Free all the strdup()ed strings.
-  for (std::vector<char *>::iterator i = newArgv.begin (), e = newArgv.end ();
-       i != e; ++i) {
+  for (std::vector<char*>::iterator i = newArgv.begin(), e = newArgv.end();
+       i != e; ++i)
     free (*i);
-  }
 }
 
 /// LookupOption - Lookup the option specified by the specified option on the






More information about the llvm-commits mailing list