[PATCH] D91861: [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 11:55:19 PST 2020


dexonsmith added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:4038-4043
   if (((FLAGS)&options::CC1Option) &&                                          \
-      (ALWAYS_EMIT || EXTRACTOR(this->KEYPATH) != DEFAULT_VALUE)) {            \
+      (ALWAYS_EMIT ||                                                          \
+       (EXTRACTOR(this->KEYPATH) != DEFAULT_VALUE && !(IMPLIED_CHECK)))) {     \
     DENORMALIZER(Args, SPELLING, NEG_SPELLING, SA, TABLE_INDEX,                \
                  EXTRACTOR(this->KEYPATH));                                    \
   }
----------------
dexonsmith wrote:
> I'm not entirely sure if the comment applies here, since a `bool` option is simpler, but it would be good to have tests to demonstrate correct behaviour for options with the following scenarios:
> - option != default, it can be implied but the antecedents are false
> - option == default, it can be implied but the antecedents are false
> - option != default, it can be implied and the antecedents are true
> - option == default, it can be implied and the antecedents are true
(Maybe the tests already exist in tree; if so, please just point me at them)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91861



More information about the cfe-commits mailing list