summaryrefslogtreecommitdiff
path: root/include/llvm/Object
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-10 07:37:33 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-10 07:37:33 +0000
commit878657074a3d65262d4c010dc2261ea688f19e8c (patch)
tree7c36abbfa347bd998b0a993f3875e9760d029fa5 /include/llvm/Object
parentfb52dba011ae1785654f2f3a3cedef2119789dc2 (diff)
downloadllvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.gz
llvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.bz2
llvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.xz
YAMLIO: Allow scalars to dictate quotation rules
Introduce ScalarTraits::mustQuote which determines whether or not a StringRef needs quoting before it is acceptable to output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/YAML.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/llvm/Object/YAML.h b/include/llvm/Object/YAML.h
index 89fe5047a8..1792e8b626 100644
--- a/include/llvm/Object/YAML.h
+++ b/include/llvm/Object/YAML.h
@@ -108,6 +108,7 @@ template <> struct ScalarTraits<object::yaml::BinaryRef> {
static void output(const object::yaml::BinaryRef &, void *,
llvm::raw_ostream &);
static StringRef input(StringRef, void *, object::yaml::BinaryRef &);
+ static bool mustQuote(StringRef S) { return needsQuotes(S); }
};
}