From 232885873fb0081acc1420ab83b14ab6f8eba280 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 27 Aug 2006 22:10:29 +0000 Subject: [PATCH] Minor code cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29917 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/CommandLine.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index d9e5cf9f474..57620b50d6c 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -214,8 +214,8 @@ static bool EatsUnboundedNumberOfValues(const Option *O) { /// using strdup (), so it is the caller's responsibility to free () /// them later. /// -static void ParseCStringVector (std::vector &output, - const char *input) { +static void ParseCStringVector(std::vector &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 @@ void cl::ParseEnvironmentOptions(const char *progName, const char *envVar, 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 newArgv; - newArgv.push_back (strdup (progName)); + std::vector 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::iterator i = newArgv.begin (), e = newArgv.end (); - i != e; ++i) { + for (std::vector::iterator i = newArgv.begin(), e = newArgv.end(); + i != e; ++i) free (*i); - } } /// LookupOption - Lookup the option specified by the specified option on the -- 2.34.1