[llvm] [llvm][Support] Add YAMLSchemeGen for producing YAML Schemes from YAMLTraits (PR #133284)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 08:12:44 PDT 2025


================
@@ -824,15 +831,17 @@ class IO {
 
   template <typename T>
   void enumCase(T &Val, const char* Str, const T ConstVal) {
-    if ( matchEnumScalar(Str, outputting() && Val == ConstVal) ) {
+    if (matchEnumScalar(Str,
+                        getKind() == IOKind::Outputting && Val == ConstVal)) {
----------------
tgs-sc wrote:

That is because generate schema should behave like Outputting in some cases and like Inputting in others. And in such a case I had to explicitly specify these places, implying that `!IOKind::Inputting == (IOKind::Outputting || IOKind::GeneratingSchema)`. I also decided to leave virtual method `outputting()` not to break backward compatibility as it is potentially can be called in IO class.

https://github.com/llvm/llvm-project/pull/133284


More information about the llvm-commits mailing list