[llvm] [llvm][Support] Add YAMLGenerateSchema for producing YAML schemas (PR #133284)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 13:01:14 PST 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)) {
----------------
slinder1 wrote:

> I also decided to leave virtual method outputting() not to break backward compatibility as it is potentially can be called in IO class.

I don't agree that this maintains backward compatibility, at least not in a meaningful way. The fact that `IOKind` is needed for `GenerateSchema` itself implies that uses of `IO` exist which are broken when relying on just `outputting()`, right?

In looking over the code (at least the latest version) I worry that the complexity is growing to the point that the current code sharing approach (a base class with conditions) is not the best approach.

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


More information about the llvm-commits mailing list