diff options
author | Sam Clegg <sbc@chromium.org> | 2017-12-14 21:10:03 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2017-12-14 21:10:03 +0000 |
commit | e1acb56f11946214ba2903e25c7cce3d9e5f7791 (patch) | |
tree | 116d9304faf586a507e28272bca84147a44a6f5e /lib/ObjectYAML | |
parent | 00bb3b5609d49633f5c456b414e80bc72da728aa (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r-- | lib/ObjectYAML/WasmYAML.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp index c206a682b83..8687f22949a 100644 --- a/lib/ObjectYAML/WasmYAML.cpp +++ b/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); |