HomePhabricator

[clang][cli] Let denormalizer decide how to render the option based on the…

Authored by jansvoboda11 on Dec 18 2020, 4:55 AM.

Description

[clang][cli] Let denormalizer decide how to render the option based on the option class

Before this patch, you needed to use AutoNormalizeEnumJoined whenever you wanted to denormalize joined enum.
Besides the naming confusion, this means the fact the option is joined is specified in two places: in the normalization multiclass and in the Joined<["-"], ...> multiclass.
This patch makes this work automatically, taking into account the OptionClass of options.

Also, the enum denormalizer now just looks up the spelling of the present enum case in a table and forwards it to the string denormalizer.

I also added more tests that exercise this.

Reviewed By: dexonsmith

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D84189