aboutsummaryrefslogtreecommitdiff
path: root/lib/ObjectYAML
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-08 17:12:57 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-08 17:12:57 +0000
commitc46e6a5940c50058e00c0c5f9123fd82e338d29a (patch)
tree89a719d723035c54a190b1f81d329834f1f93336 /lib/ObjectYAML
parent148779df305667b6942fee7e758fdf81a6498f38 (diff)
Vendor import of llvm trunk r302418:vendor/llvm/llvm-trunk-r302418
Notes
Notes: svn path=/vendor/llvm/dist/; revision=317948 svn path=/vendor/llvm/llvm-trunk-r302418/; revision=317950; tag=vendor/llvm/llvm-trunk-r302418
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r--lib/ObjectYAML/WasmYAML.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp
index 9b1ff7e5dc16..c5d1b438ee2a 100644
--- a/lib/ObjectYAML/WasmYAML.cpp
+++ b/lib/ObjectYAML/WasmYAML.cpp
@@ -50,7 +50,11 @@ static void commonSectionMapping(IO &IO, WasmYAML::Section &Section) {
static void sectionMapping(IO &IO, WasmYAML::CustomSection &Section) {
commonSectionMapping(IO, Section);
IO.mapRequired("Name", Section.Name);
- IO.mapRequired("Payload", Section.Payload);
+ if (Section.Name == "name") {
+ IO.mapOptional("FunctionNames", Section.FunctionNames);
+ } else {
+ IO.mapRequired("Payload", Section.Payload);
+ }
}
static void sectionMapping(IO &IO, WasmYAML::TypeSection &Section) {
@@ -226,6 +230,12 @@ void MappingTraits<WasmYAML::Relocation>::mapping(
IO.mapOptional("Addend", Relocation.Addend, 0);
}
+void MappingTraits<WasmYAML::NameEntry>::mapping(
+ IO &IO, WasmYAML::NameEntry &NameEntry) {
+ IO.mapRequired("Index", NameEntry.Index);
+ IO.mapRequired("Name", NameEntry.Name);
+}
+
void MappingTraits<WasmYAML::LocalDecl>::mapping(
IO &IO, WasmYAML::LocalDecl &LocalDecl) {
IO.mapRequired("Type", LocalDecl.Type);