YAMLIO: Fix string quoting logic.
authorRui Ueyama <ruiu@google.com>
Wed, 11 Sep 2013 00:45:48 +0000 (00:45 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 11 Sep 2013 00:45:48 +0000 (00:45 +0000)
commit7eb8b0fd84474f6a77ffa6211c0c753ed3142277
treea2a49ebbcc7613248cef49b5d978dae7bf59cd8a
parentf532d448307215c9ddc1dbdea42afa74757c5e00
YAMLIO: Fix string quoting logic.

YAMLIO printed a string as is without quotes unless it contains a newline
character. That did not suffice. We also need to quote a string if it starts
with a backquote, quote, double quote or atsign, or it's the empty string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190469 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/YAMLTraits.cpp
unittests/Support/YAMLIOTest.cpp