[PATCH] D88859: APINotes: add APINotesYAMLCompiler

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 14:35:00 PDT 2020


compnerd marked 4 inline comments as done.
compnerd added inline comments.


================
Comment at: clang/lib/APINotes/APINotesYAMLCompiler.cpp:439
+  static void enumeration(IO &IO, EnumExtensibilityKind &EEK) {
+    IO.enumCase(EEK, "none",   EnumExtensibilityKind::None);
+    IO.enumCase(EEK, "open",   EnumExtensibilityKind::Open);
----------------
compnerd wrote:
> martong wrote:
> > compnerd wrote:
> > > martong wrote:
> > > > Hmm, why do we need "none"? Can't we interpret the non-existence as "none"?
> > > At the very least we need it for compatibility - this is already a shipping feature.  However, nullability is also not completely annotated.  So, there is some benefit in tracking the explicit none vs missing.
> > `Optional<EnumExtensibilityAttr::Kind>` ?
> That representation could work, let me see if I can get `YAML::IO` to provide something which would be compatible.
The representation is already `Optional<EnumExtensibilityAttr::Kind>`, but we need to map the user providing `none` back to a `llvm::None` so this will still need to be listed as is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88859



More information about the cfe-commits mailing list