diff options
author | Sam Clegg <sbc@chromium.org> | 2017-09-29 16:50:08 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2017-09-29 16:50:08 +0000 |
commit | e2864173a35702567e3f4aca414ebdf40a5f3b01 (patch) | |
tree | 13e7225985a1291e7a41d0ac8c9a64e88fd9dc93 /lib/ObjectYAML | |
parent | 33bfd3f57755fc81fb2102cd64de76bb415ba586 (diff) |
[WebAssembly] Allow each data segment to specify its own alignment
Also, add a flags field as we will almost certainly
be needing that soon too.
Differential Revision: https://reviews.llvm.org/D38296
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r-- | lib/ObjectYAML/WasmYAML.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp index a5c1d13598c..2f961cf68a0 100644 --- a/lib/ObjectYAML/WasmYAML.cpp +++ b/lib/ObjectYAML/WasmYAML.cpp @@ -58,9 +58,8 @@ static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) { commonSectionMapping(IO, Section); IO.mapRequired("Name", Section.Name); IO.mapRequired("DataSize", Section.DataSize); - IO.mapRequired("DataAlignment", Section.DataAlignment); IO.mapOptional("SymbolInfo", Section.SymbolInfos); - IO.mapOptional("SegmentNames", Section.SegmentNames); + IO.mapOptional("SegmentInfo", Section.SegmentInfos); } static void sectionMapping(IO &IO, WasmYAML::CustomSection &Section) { @@ -266,6 +265,14 @@ void MappingTraits<WasmYAML::NameEntry>::mapping( IO.mapRequired("Name", NameEntry.Name); } +void MappingTraits<WasmYAML::SegmentInfo>::mapping( + IO &IO, WasmYAML::SegmentInfo &SegmentInfo) { + IO.mapRequired("Index", SegmentInfo.Index); + IO.mapRequired("Name", SegmentInfo.Name); + IO.mapRequired("Alignment", SegmentInfo.Alignment); + IO.mapRequired("Flags", SegmentInfo.Flags); +} + void MappingTraits<WasmYAML::LocalDecl>::mapping( IO &IO, WasmYAML::LocalDecl &LocalDecl) { IO.mapRequired("Type", LocalDecl.Type); |