================
@@ -622,15 +622,38 @@ template <> struct 
ScalarEnumerationTraits<FormatStyle::ShortBlockStyle> {
   }
 };
 
-template <> struct ScalarEnumerationTraits<FormatStyle::ShortFunctionStyle> {
-  static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) {
-    IO.enumCase(Value, "None", FormatStyle::SFS_None);
-    IO.enumCase(Value, "false", FormatStyle::SFS_None);
-    IO.enumCase(Value, "All", FormatStyle::SFS_All);
-    IO.enumCase(Value, "true", FormatStyle::SFS_All);
-    IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline);
-    IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly);
-    IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty);
+template <> struct MappingTraits<FormatStyle::ShortFunctionStyle> {
+  static void enumInput(IO &IO, FormatStyle::ShortFunctionStyle &Value) {
+    IO.enumCase(Value, "None", FormatStyle::ShortFunctionStyle({}));
+    IO.enumCase(Value, "Empty",
+                FormatStyle::ShortFunctionStyle({/*Empty=*/true,
+                                                 /*Inline=*/false,
+                                                 /*Other=*/false}));
+    IO.enumCase(Value, "Inline",
+                FormatStyle::ShortFunctionStyle({/*Empty=*/true,
+                                                 /*Inline=*/true,
+                                                 /*Other=*/false}));
+    IO.enumCase(Value, "InlineOnly",
+                FormatStyle::ShortFunctionStyle({/*Empty=*/false,
+                                                 /*Inline=*/true,
+                                                 /*Other=*/false}));
+    IO.enumCase(Value, "All",
+                FormatStyle::ShortFunctionStyle({/*Empty=*/true,
+                                                 /*Inline=*/true,
+                                                 /*Other=*/true}));
+
+    // For backward compatibility.
+    IO.enumCase(Value, "true",
+                FormatStyle::ShortFunctionStyle({/*Empty=*/true,
+                                                 /*Inline=*/true,
+                                                 /*Other=*/true}));
+    IO.enumCase(Value, "false", FormatStyle::ShortFunctionStyle({}));
----------------
owenca wrote:

I don't think we need to remap true/false.

https://github.com/llvm/llvm-project/pull/134337
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to