summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/WasmYAML.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-12-14 21:10:03 +0000
committerSam Clegg <sbc@chromium.org>2017-12-14 21:10:03 +0000
commit4273998cf9013ce92c7bf1effafef76a65e31d0c (patch)
tree940a95fe5e68525d73669766b55dc1a7c9be7832 /llvm/lib/ObjectYAML/WasmYAML.cpp
parentea244bf89b794802a0a5addeed74919a605f8636 (diff)
downloadbcm5719-llvm-4273998cf9013ce92c7bf1effafef76a65e31d0c.tar.gz
bcm5719-llvm-4273998cf9013ce92c7bf1effafef76a65e31d0c.zip
[WebAssembly] Add support for init functions linking metadata
Summary: This change lays the groundwork lowering of @llvm.global_ctors and @llvm.global_dtors for the wasm object format. Some parts of this patch are subset of: https://reviews.llvm.org/D40759 See https://github.com/WebAssembly/tool-conventions/issues/25 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41208 llvm-svn: 320742
Diffstat (limited to 'llvm/lib/ObjectYAML/WasmYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/WasmYAML.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index c206a682b83..8687f22949a 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -60,6 +60,7 @@ static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) {
IO.mapRequired("DataSize", Section.DataSize);
IO.mapOptional("SymbolInfo", Section.SymbolInfos);
IO.mapOptional("SegmentInfo", Section.SegmentInfos);
+ IO.mapOptional("InitFunctions", Section.InitFunctions);
}
static void sectionMapping(IO &IO, WasmYAML::CustomSection &Section) {
@@ -359,6 +360,12 @@ void MappingTraits<WasmYAML::DataSegment>::mapping(
IO.mapRequired("Content", Segment.Content);
}
+void MappingTraits<WasmYAML::InitFunction>::mapping(
+ IO &IO, WasmYAML::InitFunction &Init) {
+ IO.mapRequired("Priority", Init.Priority);
+ IO.mapRequired("FunctionIndex", Init.FunctionIndex);
+}
+
void MappingTraits<WasmYAML::SymbolInfo>::mapping(IO &IO,
WasmYAML::SymbolInfo &Info) {
IO.mapRequired("Name", Info.Name);
OpenPOWER on IntegriCloud