[PATCH] D39908: Allow empty mappings for optional YAML input

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 21:58:44 PST 2017


compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Support/YAMLTraits.cpp:164
+    bool OptionalNode = !Required && isa<EmptyHNode>(CurrentNode);
+    if (!OptionalNode)
+      setError(CurrentNode, "not a mapping");
----------------
I would inline and apply Demorgan's:

    if (Required || !isa<EmptyHNode>(CurrentNode))
      setError(...)


https://reviews.llvm.org/D39908





More information about the llvm-commits mailing list