summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCModuleYAML.cpp
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
commit7788033be626836f2543a63ab2150e287418cba5 (patch)
treed2920c0b74e8b1ec11bc3dbb41265cfc3a5e545c /llvm/lib/MC/MCModuleYAML.cpp
parent220c0d1f5ed2abcf00b583acf5782dfcdace0812 (diff)
downloadbcm5719-llvm-7788033be626836f2543a63ab2150e287418cba5.tar.gz
bcm5719-llvm-7788033be626836f2543a63ab2150e287418cba5.zip
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. llvm-svn: 205955
Diffstat (limited to 'llvm/lib/MC/MCModuleYAML.cpp')
-rw-r--r--llvm/lib/MC/MCModuleYAML.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCModuleYAML.cpp b/llvm/lib/MC/MCModuleYAML.cpp
index 102971b7320..432652b0db9 100644
--- a/llvm/lib/MC/MCModuleYAML.cpp
+++ b/llvm/lib/MC/MCModuleYAML.cpp
@@ -162,12 +162,14 @@ template <> struct ScalarTraits<MCModuleYAML::Operand> {
static void output(const MCModuleYAML::Operand &, void *,
llvm::raw_ostream &);
static StringRef input(StringRef, void *, MCModuleYAML::Operand &);
+ static bool mustQuote(StringRef) { return false; }
};
template <> struct ScalarTraits<MCModuleYAML::OpcodeEnum> {
static void output(const MCModuleYAML::OpcodeEnum &, void *,
llvm::raw_ostream &);
static StringRef input(StringRef, void *, MCModuleYAML::OpcodeEnum &);
+ static bool mustQuote(StringRef) { return false; }
};
void ScalarEnumerationTraits<MCAtom::AtomKind>::enumeration(
OpenPOWER on IntegriCloud