[llvm] [Support][YamlTraits] Add quoting for keys in textual YAML representation (PR #88763)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 14:06:03 PDT 2024


================
@@ -801,6 +769,45 @@ void Output::output(StringRef s) {
   Out << s;
 }
 
+void Output::output(StringRef S, QuotingType MustQuote) {
+  if (MustQuote == QuotingType::None) {
+    // Only quote if we must.
+    output(S);
+    return;
+  }
+
+  const char *const Quote = MustQuote == QuotingType::Single ? "'" : "\"";
----------------
arsenm wrote:

StringLiteral? 

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


More information about the llvm-commits mailing list