diff options
author | Fangrui Song <maskray@google.com> | 2020-07-31 10:46:27 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-07-31 10:48:09 -0700 |
commit | c068e9c8c123e7f8c8f3feb57245a012ccd09ccf (patch) | |
tree | 1eec1e330ee35c219ecf0b0d154c4f4dc3b8d134 /llvm/lib/Support/CommandLine.cpp | |
parent | 93fd8dbdc250330b84eeca3387e895407663d750 (diff) | |
download | llvm-c068e9c8c123e7f8c8f3feb57245a012ccd09ccf.zip llvm-c068e9c8c123e7f8c8f3feb57245a012ccd09ccf.tar.gz llvm-c068e9c8c123e7f8c8f3feb57245a012ccd09ccf.tar.bz2 |
[Support][CommandLine] Delete unused llvm::cl::ParseEnvrironmentOptions
The function was added in 2003. It is not used and can be emulated with ParseCommandLineOptions.
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 12ef0d5..4fba6a9 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1271,36 +1271,6 @@ bool cl::readConfigFile(StringRef CfgFile, StringSaver &Saver, /*MarkEOLs*/ false, /*RelativeNames*/ true); } -/// ParseEnvironmentOptions - An alternative entry point to the -/// CommandLine library, which allows you to read the program's name -/// from the caller (as PROGNAME) and its command-line arguments from -/// an environment variable (whose name is given in ENVVAR). -/// -void cl::ParseEnvironmentOptions(const char *progName, const char *envVar, - const char *Overview) { - // Check args. - assert(progName && "Program name not specified"); - assert(envVar && "Environment variable name missing"); - - // Get the environment variable they want us to parse options out of. - llvm::Optional<std::string> envValue = sys::Process::GetEnv(StringRef(envVar)); - if (!envValue) - return; - - // Get program's "name", which we wouldn't know without the caller - // telling us. - SmallVector<const char *, 20> newArgv; - BumpPtrAllocator A; - StringSaver Saver(A); - newArgv.push_back(Saver.save(progName).data()); - - // Parse the value of the environment variable into a "command line" - // and hand it off to ParseCommandLineOptions(). - TokenizeGNUCommandLine(*envValue, Saver, newArgv); - int newArgc = static_cast<int>(newArgv.size()); - ParseCommandLineOptions(newArgc, &newArgv[0], StringRef(Overview)); -} - bool cl::ParseCommandLineOptions(int argc, const char *const *argv, StringRef Overview, raw_ostream *Errs, const char *EnvVar, |