diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2015-05-01 18:34:25 +0000 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2015-05-01 18:34:25 +0000 |
| commit | 42e91fa312908d70d1e8c4dc13ec459d1c68bdb1 (patch) | |
| tree | 1d8eed4a78fc23d7b0bfe7a74e726012e91400a7 /llvm/lib/Support | |
| parent | 684379a00b1cdda71f4d2b88ee8d323aeaab78fe (diff) | |
| download | bcm5719-llvm-42e91fa312908d70d1e8c4dc13ec459d1c68bdb1.tar.gz bcm5719-llvm-42e91fa312908d70d1e8c4dc13ec459d1c68bdb1.zip | |
YAML: Fix the output of sequences that contain flow sequences.
This patch fixes a bug where the YAML Output class emitted
a sequence of flow sequences without the '-' characters.
Before:
seq:
[ a, b ]
[ c, d ]
After:
seq:
- [ a, b ]
- [ c, d ]
Reviewers: Justin Bogner
Differential Revision: http://reviews.llvm.org/D9206
llvm-svn: 236329
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/YAMLTraits.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index 74e541449f2..16821738190 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -633,7 +633,8 @@ void Output::newLineCheck() { if (StateStack.back() == inSeq) { OutputDash = true; - } else if ((StateStack.size() > 1) && (StateStack.back() == inMapFirstKey) && + } else if ((StateStack.size() > 1) && ((StateStack.back() == inMapFirstKey) || + (StateStack.back() == inFlowSeq)) && (StateStack[StateStack.size() - 2] == inSeq)) { --Indent; OutputDash = true; |

