diff options
Diffstat (limited to 'docs/CompilerDriver.html')
-rw-r--r-- | docs/CompilerDriver.html | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index 3af190d..b69b8c9 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -334,8 +334,8 @@ once). Incompatible with <tt class="docutils literal"><span class="pre">zero_or_ only for list options in conjunction with <tt class="docutils literal"><span class="pre">multi_val</span></tt>; for ordinary lists it is synonymous with <tt class="docutils literal"><span class="pre">required</span></tt>. Incompatible with <tt class="docutils literal"><span class="pre">required</span></tt> and <tt class="docutils literal"><span class="pre">zero_or_one</span></tt>.</li> -<li><tt class="docutils literal"><span class="pre">zero_or_one</span></tt> - the option can be specified zero or one times. Useful -only for list options in conjunction with <tt class="docutils literal"><span class="pre">multi_val</span></tt>. Incompatible with +<li><tt class="docutils literal"><span class="pre">optional</span></tt> - the option can be specified zero or one times. Useful only +for list options in conjunction with <tt class="docutils literal"><span class="pre">multi_val</span></tt>. Incompatible with <tt class="docutils literal"><span class="pre">required</span></tt> and <tt class="docutils literal"><span class="pre">one_or_more</span></tt>.</li> <li><tt class="docutils literal"><span class="pre">hidden</span></tt> - the description of this option will not appear in the <tt class="docutils literal"><span class="pre">--help</span></tt> output (but will appear in the <tt class="docutils literal"><span class="pre">--help-hidden</span></tt> @@ -350,13 +350,14 @@ gcc's <tt class="docutils literal"><span class="pre">-Wa,</span></tt>.</li> <li><tt class="docutils literal"><span class="pre">multi_val</span> <span class="pre">n</span></tt> - this option takes <em>n</em> arguments (can be useful in some special cases). Usage example: <tt class="docutils literal"><span class="pre">(parameter_list_option</span> <span class="pre">"foo",</span> <span class="pre">(multi_val</span> <span class="pre">3))</span></tt>; the command-line syntax is '-foo a b c'. Only list options can have -this attribute; you can, however, use the <tt class="docutils literal"><span class="pre">one_or_more</span></tt>, <tt class="docutils literal"><span class="pre">zero_or_one</span></tt> +this attribute; you can, however, use the <tt class="docutils literal"><span class="pre">one_or_more</span></tt>, <tt class="docutils literal"><span class="pre">optional</span></tt> and <tt class="docutils literal"><span class="pre">required</span></tt> properties.</li> <li><tt class="docutils literal"><span class="pre">init</span></tt> - this option has a default value, either a string (if it is a -parameter), or a boolean (if it is a switch; boolean constants are called -<tt class="docutils literal"><span class="pre">true</span></tt> and <tt class="docutils literal"><span class="pre">false</span></tt>). List options can't have this attribute. Usage -examples: <tt class="docutils literal"><span class="pre">(switch_option</span> <span class="pre">"foo",</span> <span class="pre">(init</span> <span class="pre">true))</span></tt>; <tt class="docutils literal"><span class="pre">(prefix_option</span> <span class="pre">"bar",</span> -<span class="pre">(init</span> <span class="pre">"baz"))</span></tt>.</li> +parameter), or a boolean (if it is a switch; as in C++, boolean constants +are called <tt class="docutils literal"><span class="pre">true</span></tt> and <tt class="docutils literal"><span class="pre">false</span></tt>). List options can't have <tt class="docutils literal"><span class="pre">init</span></tt> +attribute. +Usage examples: <tt class="docutils literal"><span class="pre">(switch_option</span> <span class="pre">"foo",</span> <span class="pre">(init</span> <span class="pre">true))</span></tt>; <tt class="docutils literal"><span class="pre">(prefix_option</span> +<span class="pre">"bar",</span> <span class="pre">(init</span> <span class="pre">"baz"))</span></tt>.</li> <li><tt class="docutils literal"><span class="pre">extern</span></tt> - this option is defined in some other plugin, see <a class="reference internal" href="#extern">below</a>.</li> </ul> </blockquote> @@ -604,10 +605,10 @@ def LanguageMap : LanguageMap< $ llvmc hello.cpp llvmc: Unknown suffix: cpp </pre> -<p>The language map entries should be added only for tools that are -linked with the root node. Since tools are not allowed to have -multiple output languages, for nodes "inside" the graph the input and -output languages should match. This is enforced at compile-time.</p> +<p>The language map entries are needed only for the tools that are linked from the +root node. Since a tool can't have multiple output languages, for inner nodes of +the graph the input and output languages should match. This is enforced at +compile-time.</p> </div> <div class="section" id="option-preprocessor"> <h1><a class="toc-backref" href="#id20">Option preprocessor</a></h1> @@ -619,22 +620,30 @@ the driver with both of these options enabled.</p> occasions. Example (adapted from the built-in Base plugin):</p> <pre class="literal-block"> def Preprocess : OptionPreprocessor< -(case (and (switch_on "O3"), (any_switch_on ["O0", "O1", "O2"])), - [(unset_option ["O0", "O1", "O2"]), - (warning "Multiple -O options specified, defaulted to -O3.")], +(case (not (any_switch_on ["O0", "O1", "O2", "O3"])), + (set_option "O2"), + (and (switch_on "O3"), (any_switch_on ["O0", "O1", "O2"])), + (unset_option ["O0", "O1", "O2"]), (and (switch_on "O2"), (any_switch_on ["O0", "O1"])), (unset_option ["O0", "O1"]), (and (switch_on "O1"), (switch_on "O0")), (unset_option "O0")) >; </pre> -<p>Here, <tt class="docutils literal"><span class="pre">OptionPreprocessor</span></tt> is used to unset all spurious optimization options -(so that they are not forwarded to the compiler).</p> +<p>Here, <tt class="docutils literal"><span class="pre">OptionPreprocessor</span></tt> is used to unset all spurious <tt class="docutils literal"><span class="pre">-O</span></tt> options so +that they are not forwarded to the compiler. If no optimization options are +specified, <tt class="docutils literal"><span class="pre">-O2</span></tt> is enabled.</p> <p><tt class="docutils literal"><span class="pre">OptionPreprocessor</span></tt> is basically a single big <tt class="docutils literal"><span class="pre">case</span></tt> expression, which is evaluated only once right after the plugin is loaded. The only allowed actions -in <tt class="docutils literal"><span class="pre">OptionPreprocessor</span></tt> are <tt class="docutils literal"><span class="pre">error</span></tt>, <tt class="docutils literal"><span class="pre">warning</span></tt> and a special action -<tt class="docutils literal"><span class="pre">unset_option</span></tt>, which, as the name suggests, unsets a given option. For -convenience, <tt class="docutils literal"><span class="pre">unset_option</span></tt> also works on lists.</p> +in <tt class="docutils literal"><span class="pre">OptionPreprocessor</span></tt> are <tt class="docutils literal"><span class="pre">error</span></tt>, <tt class="docutils literal"><span class="pre">warning</span></tt>, and two special actions: +<tt class="docutils literal"><span class="pre">unset_option</span></tt> and <tt class="docutils literal"><span class="pre">set_option</span></tt>. As their names suggest, they can be used to +set or unset a given option. To set an option with <tt class="docutils literal"><span class="pre">set_option</span></tt>, use the +two-argument form: <tt class="docutils literal"><span class="pre">(set_option</span> <span class="pre">"parameter",</span> <span class="pre">VALUE)</span></tt>. Here, <tt class="docutils literal"><span class="pre">VALUE</span></tt> can be +either a string, a string list, or a boolean constant.</p> +<p>For convenience, <tt class="docutils literal"><span class="pre">set_option</span></tt> and <tt class="docutils literal"><span class="pre">unset_option</span></tt> also work on lists. That +is, instead of <tt class="docutils literal"><span class="pre">[(unset_option</span> <span class="pre">"A"),</span> <span class="pre">(unset_option</span> <span class="pre">"B")]</span></tt> you can use +<tt class="docutils literal"><span class="pre">(unset_option</span> <span class="pre">["A",</span> <span class="pre">"B"])</span></tt>. Obviously, <tt class="docutils literal"><span class="pre">(set_option</span> <span class="pre">["A",</span> <span class="pre">"B"])</span></tt> is valid +only if both <tt class="docutils literal"><span class="pre">A</span></tt> and <tt class="docutils literal"><span class="pre">B</span></tt> are switches.</p> </div> <div class="section" id="more-advanced-topics"> <h1><a class="toc-backref" href="#id21">More advanced topics</a></h1> @@ -739,7 +748,7 @@ the <tt class="docutils literal"><span class="pre">Base</span></tt> plugin behav <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a><br /> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br /> -Last modified: $Date: 2009-12-07 19:26:24 +0100 (Mon, 07 Dec 2009) $ +Last modified: $Date: 2009-12-23 13:49:51 +0100 (Wed, 23 Dec 2009) $ </address></div> </div> </div> |