diff --git a/llvm/docs/CompilerDriver.html b/llvm/docs/CompilerDriver.html index 0a3f87716235..92eec2bbe9ed 100644 --- a/llvm/docs/CompilerDriver.html +++ b/llvm/docs/CompilerDriver.html @@ -334,8 +334,8 @@ once). Incompatible with zero_or_ only for list options in conjunction with multi_val; for ordinary lists it is synonymous with required. Incompatible with required and zero_or_one. -
  • zero_or_one - the option can be specified zero or one times. Useful -only for list options in conjunction with multi_val. Incompatible with +
  • optional - the option can be specified zero or one times. Useful only +for list options in conjunction with multi_val. Incompatible with required and one_or_more.
  • hidden - the description of this option will not appear in the --help output (but will appear in the --help-hidden @@ -350,13 +350,14 @@ gcc's -Wa,.
  • multi_val n - this option takes n arguments (can be useful in some special cases). Usage example: (parameter_list_option "foo", (multi_val 3)); the command-line syntax is '-foo a b c'. Only list options can have -this attribute; you can, however, use the one_or_more, zero_or_one +this attribute; you can, however, use the one_or_more, optional and required properties.
  • init - 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 -true and false). List options can't have this attribute. Usage -examples: (switch_option "foo", (init true)); (prefix_option "bar", -(init "baz")).
  • +parameter), or a boolean (if it is a switch; as in C++, boolean constants +are called true and false). List options can't have init +attribute. +Usage examples: (switch_option "foo", (init true)); (prefix_option +"bar", (init "baz")).
  • extern - this option is defined in some other plugin, see below.
  • @@ -604,10 +605,10 @@ def LanguageMap : LanguageMap< $ llvmc hello.cpp llvmc: Unknown suffix: cpp -

    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.

    +

    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.

    Option preprocessor

    @@ -619,22 +620,28 @@ the driver with both of these options enabled.

    occasions. Example (adapted from the built-in Base plugin):

     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"))
     >;
     
    -

    Here, OptionPreprocessor is used to unset all spurious optimization options -(so that they are not forwarded to the compiler).

    +

    Here, OptionPreprocessor is used to unset all spurious -O options so +that they are not forwarded to the compiler. If no optimization options are +specified, -O2 is enabled.

    OptionPreprocessor is basically a single big case expression, which is evaluated only once right after the plugin is loaded. The only allowed actions -in OptionPreprocessor are error, warning and a special action -unset_option, which, as the name suggests, unsets a given option. For -convenience, unset_option also works on lists.

    +in OptionPreprocessor are error, warning and two special actions: +unset_option and set_option. As their names suggest, they can be used to +set or unset a given option. To set a parameter option with set_option, use +the two-argument form: (set_option "parameter", "value"). For convenience, +set_option and unset_option also work on lists (that is, instead of +[(unset_option "A"), (unset_option "B")] you can use (unset_option ["A", +"B"])).