summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/wasm2yaml.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-09-29 16:50:08 +0000
committerSam Clegg <sbc@chromium.org>2017-09-29 16:50:08 +0000
commit63ebb81386393c84d990e5e1bd52938eeb596f47 (patch)
tree95bacc2d0a9e8e1726c580decb1a2b55ccb65e8a /llvm/tools/obj2yaml/wasm2yaml.cpp
parent113708b7cb30277a89a4b65d8ae4c8370b6b1841 (diff)
downloadbcm5719-llvm-63ebb81386393c84d990e5e1bd52938eeb596f47.tar.gz
bcm5719-llvm-63ebb81386393c84d990e5e1bd52938eeb596f47.zip
[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 llvm-svn: 314534
Diffstat (limited to 'llvm/tools/obj2yaml/wasm2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/wasm2yaml.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp
index d37599bd202..27398e5b00b 100644
--- a/llvm/tools/obj2yaml/wasm2yaml.cpp
+++ b/llvm/tools/obj2yaml/wasm2yaml.cpp
@@ -68,10 +68,12 @@ std::unique_ptr<WasmYAML::CustomSection> WasmDumper::dumpCustomSection(const Was
size_t Index = 0;
for (const object::WasmSegment &Segment : Obj.dataSegments()) {
if (!Segment.Data.Name.empty()) {
- WasmYAML::NameEntry NameEntry;
- NameEntry.Name = Segment.Data.Name;
- NameEntry.Index = Index;
- LinkingSec->SegmentNames.push_back(NameEntry);
+ WasmYAML::SegmentInfo SegmentInfo;
+ SegmentInfo.Name = Segment.Data.Name;
+ SegmentInfo.Index = Index;
+ SegmentInfo.Alignment = Segment.Data.Alignment;
+ SegmentInfo.Flags = Segment.Data.Flags;
+ LinkingSec->SegmentInfos.push_back(SegmentInfo);
}
Index++;
}
@@ -83,7 +85,6 @@ std::unique_ptr<WasmYAML::CustomSection> WasmDumper::dumpCustomSection(const Was
}
}
LinkingSec->DataSize = Obj.linkingData().DataSize;
- LinkingSec->DataAlignment = Obj.linkingData().DataAlignment;
CustomSec = std::move(LinkingSec);
} else {
CustomSec = make_unique<WasmYAML::CustomSection>(WasmSec.Name);
OpenPOWER on IntegriCloud