diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-24 06:13:42 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-24 06:13:42 +0000 |
commit | 5f8448f79c2876466d586f2e1caec89e6f070623 (patch) | |
tree | c847ad82acf2665e54db3aefed36c9d79946d67e | |
parent | e4ed742588d6063c4cc778a57102f8c37e35d3b5 (diff) | |
download | external_llvm-5f8448f79c2876466d586f2e1caec89e6f070623.zip external_llvm-5f8448f79c2876466d586f2e1caec89e6f070623.tar.gz external_llvm-5f8448f79c2876466d586f2e1caec89e6f070623.tar.bz2 |
Implement and document prefix options with arbitrary values including an
= sign. This needed to support -DNAME=value options as pass-through in
llvmc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18203 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/CommandLine.html | 16 | ||||
-rw-r--r-- | lib/Support/CommandLine.cpp | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/docs/CommandLine.html b/docs/CommandLine.html index 55f5484..4f749b7 100644 --- a/docs/CommandLine.html +++ b/docs/CommandLine.html @@ -1276,13 +1276,15 @@ Arguments</a> section for more information.</li> specifies that this option is used to capture "interpreter style" arguments. See <a href="#cl::ConsumeAfter">this section for more information</a>.</li> <li><a name="cl::Prefix">The <b><tt>cl::Prefix</tt></b></a> modifier specifies -that this option prefixes its value. With 'Prefix' options, there is no equal -sign that separates the value from the option name specified. This is useful -for processing odd arguments like '<tt>-lmalloc -L/usr/lib'</tt> in a linker -tool. Here, the '<tt>l</tt>' and '<tt>L</tt>' options are normal string (list) -options, that have the <a href="#cl::Prefix">cl::Prefix</a> modifier added to -allow the CommandLine library to recognize them. Note that <a -href="#cl::Prefix">cl::Prefix</a> options must not have the <a +that this option prefixes its value. With 'Prefix' options, the equal sign does +not separate the value from the option name specified. Instead, the value is +everything after the prefix, including any equal sign if present. This is useful +for processing odd arguments like <tt>-lmalloc</tt> and <tt>-L/usr/lib</tt> in a +linker tool or <tt>-DNAME=value</tt> in a compiler tool. Here, the +'<tt>l</tt>', '<tt>D</tt>' and '<tt>L</tt>' options are normal string (or list) +options, that have the <a href="#cl::Prefix">cl::Prefix</a> modifier added to +allow the CommandLine library to recognize them. Note that +<a href="#cl::Prefix">cl::Prefix</a> options must not have the <a href="#cl::ValueDisallowed">cl::ValueDisallowed</a> modifier specified.</li> <li><a name="cl::Grouping">The <b><tt>cl::Grouping</tt></b></a> modifier is used diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 9ae4cde..52e4bbd 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -397,7 +397,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv, Handler = LookupOption(ArgName, Value); // Check to see if this "option" is really a prefixed or grouped argument. - if (Handler == 0 && *Value == 0) { + if (Handler == 0) { std::string RealName(ArgName); if (RealName.size() > 1) { unsigned Length = 0; |