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

Timur Golubovich via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 13:04:48 PDT 2025


================
@@ -0,0 +1,124 @@
+//===- YAMLGenerateSchemaTest.cpp - Tests for Generating YAML Schema ------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/YAMLGenerateSchema.h"
+#include "llvm/Support/YAMLTraits.h"
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+using namespace llvm;
+
+enum class ColorTy {
+  White,
+  Black,
+  Blue,
+};
+
+struct Baby {
+  std::string Name;
+  ColorTy Color;
+};
+
+LLVM_YAML_IS_SEQUENCE_VECTOR(Baby)
+
+struct Animal {
+  std::string Name;
+  std::optional<int> Age;
----------------
tgs-sc wrote:

Addressed

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


More information about the llvm-commits mailing list