[PATCH] D82756: Port some floating point options to new option marshalling infrastructure

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 11:59:32 PDT 2020


dexonsmith added a comment.

I have an idea: use `DEFAULT_VALUE` to keep current behaviour. Here's an example to demonstrate.

`cl_mad_enable` is implied by `OPT_cl_unsafe_math_optimizations` or `OPT_cl_fast_relaxed_math`. Instead of setting the default value to `"false"` it could be set to `"CodeGenOpts.CLUnsafeMath || LangOpts.FastRelaxedMath"` (one hitch is that `CLUnsafeMath` doesn't currently exist).

You'd need to update the `OPTION_WITH_MARSHALLING_FLAG` definition in `parseSimpleArgs` to something like:

  #define OPTION_WITH_MARSHALLING_FLAG(PREFIX_TYPE, NAME, ID, KIND, GROUP,       \
                                       ALIAS, ALIASARGS, FLAGS, PARAM, HELPTEXT, \
                                       METAVAR, VALUES, SPELLING, ALWAYS_EMIT,   \
                                       KEYPATH, DEFAULT_VALUE, IS_POSITIVE)      \
    this->KEYPATH = (Args.hasArg(OPT_##ID) && IS_POSITIVE) || (DEFAULT_VALUE);

@Bigcheese / @jansvoboda11 , WDYT?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82756/new/

https://reviews.llvm.org/D82756



More information about the llvm-commits mailing list