diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-02-25 08:38:57 +0100 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-02-25 08:47:18 +0100 |
commit | 88e45f00c156170ed562bbacad3b2a21633c0f7a (patch) | |
tree | f8f9c25e1ca32c9b9502a3ead600b1bb0f927a96 /clang/docs/InternalsManual.rst | |
parent | 2d870a2f557b6aea9f37594a3341a2e890db8621 (diff) | |
download | llvm-88e45f00c156170ed562bbacad3b2a21633c0f7a.zip llvm-88e45f00c156170ed562bbacad3b2a21633c0f7a.tar.gz llvm-88e45f00c156170ed562bbacad3b2a21633c0f7a.tar.bz2 |
[clang][cli] Add MarshallingInfoEnum multiclass
This patch introduces a tablegen multiclass called `MarshallingInfoEnum`. It has the same semantics as `MarshallingInfoString` had in combination with `AutoNormalizeEnum`, but it's easier to use and follows the convention used for other `MarshallingInfoXxx` multiclasses.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D97375
Diffstat (limited to 'clang/docs/InternalsManual.rst')
-rw-r--r-- | clang/docs/InternalsManual.rst | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst index da17d72..ec01875 100644 --- a/clang/docs/InternalsManual.rst +++ b/clang/docs/InternalsManual.rst @@ -940,23 +940,22 @@ and the result is assigned to the key path on success. **Enumeration** -The key path defaults to the value specified in ``MarshallingInfoString`` -prefixed by the contents of ``NormalizedValuesScope`` and ``::``. This ensures -correct reference to an enum case is formed even if the enum resides in different +The key path defaults to the value specified in ``MarshallingInfoEnum`` prefixed +by the contents of ``NormalizedValuesScope`` and ``::``. This ensures correct +reference to an enum case is formed even if the enum resides in different namespace or is an enum class. If the value present on command line does not match any of the comma-separated values from ``Values``, an error diagnostics is issued. Otherwise, the corresponding element from ``NormalizedValues`` at the same index is assigned to the key path (also correctly scoped). The number of comma-separated string values and elements of the array within -``NormalizedValues`` must match. The ``AutoNormalizeEnum`` mix-in denotes the -key path option should be treated as an enum and not as a string. +``NormalizedValues`` must match. .. code-block:: def mthread_model : Separate<["-"], "mthread-model">, Flags<[CC1Option]>, Values<"posix,single">, NormalizedValues<["POSIX", "Single"]>, NormalizedValuesScope<"LangOptions::ThreadModelKind">, - MarshallingInfoString<LangOpts<"ThreadModel">, "POSIX">, AutoNormalizeEnum; + MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">; .. Intentionally omitting MarshallingInfoBitfieldFlag. It's adding some |