summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-05-04 20:11:40 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-05-04 20:11:40 +0000
commitb1225085012ad7fc8f45c3683a6220868273c284 (patch)
treea84b6034ebcbfd2fe713963e26fcb559f42f1829 /llvm/docs
parentd71a17710beaa2c95aeaf51f264c7436a69a4b35 (diff)
downloadbcm5719-llvm-b1225085012ad7fc8f45c3683a6220868273c284.tar.gz
bcm5719-llvm-b1225085012ad7fc8f45c3683a6220868273c284.zip
YAML: Add an optional 'flow' field to the mapping trait to allow flow mapping output.
This patch adds an optional 'flow' field to the MappingTrait class so that yaml IO will be able to output flow mappings. Reviewers: Justin Bogner Differential Revision: http://reviews.llvm.org/D9450 llvm-svn: 236456
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/YamlIO.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/docs/YamlIO.rst b/llvm/docs/YamlIO.rst
index 8b45b6bb85b..ab8b19ac2a5 100644
--- a/llvm/docs/YamlIO.rst
+++ b/llvm/docs/YamlIO.rst
@@ -723,6 +723,31 @@ because it is a programming error to have invalid struct values.
}
};
+Flow Mapping
+------------
+A YAML "flow mapping" is a mapping that uses the inline notation
+(e.g { x: 1, y: 0 } ) when written to YAML. To specify that a type should be
+written in YAML using flow mapping, your MappingTraits specialization should
+add "static const bool flow = true;". For instance:
+
+.. code-block:: c++
+
+ using llvm::yaml::MappingTraits;
+ using llvm::yaml::IO;
+
+ struct Stuff {
+ ...
+ };
+
+ template <>
+ struct MappingTraits<Stuff> {
+ static void mapping(IO &io, Stuff &stuff) {
+ ...
+ }
+
+ static const bool flow = true;
+ }
+
Sequence
========
OpenPOWER on IntegriCloud