From 33ae7cea9fc7bb880fb8169e6f6848acddb36fe6 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 11 Sep 2013 01:59:32 +0000 Subject: Revert "YAMLIO: Fix string quoting logic." (r190469) It was turning the buildbots red. llvm-svn: 190480 --- llvm/lib/Support/YAMLTraits.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Support/YAMLTraits.cpp') diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index d0e4b1b902d..cf19509ee88 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -509,16 +509,8 @@ void Output::endBitSetScalar() { void Output::scalarString(StringRef &S) { this->newLineCheck(); - - if (S.empty()) { - // Print '' for the empty string because leaving the field empty is not - // allowed. - this->outputUpToEndOfLine("''"); - return; - } - if (!strchr("'`@\"", S.front()) && S.find('\n') == StringRef::npos) { - // Plain string cannot start with double quote or single quote. Backquote - // and atsign are reserved characters. Newline is not allowed. + if (S.find('\n') == StringRef::npos) { + // No embedded new-line chars, just print string. this->outputUpToEndOfLine(S); return; } -- cgit v1.2.3