Lines Matching full:section
33 void writeRelocSection(raw_ostream &OS, WasmYAML::Section &Sec,
38 void writeSectionContent(raw_ostream &OS, WasmYAML::CustomSection &Section);
39 void writeSectionContent(raw_ostream &OS, WasmYAML::TypeSection &Section);
40 void writeSectionContent(raw_ostream &OS, WasmYAML::ImportSection &Section);
41 void writeSectionContent(raw_ostream &OS, WasmYAML::FunctionSection &Section);
42 void writeSectionContent(raw_ostream &OS, WasmYAML::TableSection &Section);
43 void writeSectionContent(raw_ostream &OS, WasmYAML::MemorySection &Section);
44 void writeSectionContent(raw_ostream &OS, WasmYAML::TagSection &Section);
45 void writeSectionContent(raw_ostream &OS, WasmYAML::GlobalSection &Section);
46 void writeSectionContent(raw_ostream &OS, WasmYAML::ExportSection &Section);
47 void writeSectionContent(raw_ostream &OS, WasmYAML::StartSection &Section);
48 void writeSectionContent(raw_ostream &OS, WasmYAML::ElemSection &Section);
49 void writeSectionContent(raw_ostream &OS, WasmYAML::CodeSection &Section);
50 void writeSectionContent(raw_ostream &OS, WasmYAML::DataSection &Section);
51 void writeSectionContent(raw_ostream &OS, WasmYAML::DataCountSection &Section);
53 // Custom section types
54 void writeSectionContent(raw_ostream &OS, WasmYAML::DylinkSection &Section);
55 void writeSectionContent(raw_ostream &OS, WasmYAML::NameSection &Section);
56 void writeSectionContent(raw_ostream &OS, WasmYAML::LinkingSection &Section);
57 void writeSectionContent(raw_ostream &OS, WasmYAML::ProducersSection &Section);
59 WasmYAML::TargetFeaturesSection &Section);
163 WasmYAML::DylinkSection &Section) { in writeSectionContent() argument
164 writeStringRef(Section.Name, OS); in writeSectionContent()
169 encodeULEB128(Section.MemorySize, SubOS); in writeSectionContent()
170 encodeULEB128(Section.MemoryAlignment, SubOS); in writeSectionContent()
171 encodeULEB128(Section.TableSize, SubOS); in writeSectionContent()
172 encodeULEB128(Section.TableAlignment, SubOS); in writeSectionContent()
175 if (Section.Needed.size()) { in writeSectionContent()
178 encodeULEB128(Section.Needed.size(), SubOS); in writeSectionContent()
179 for (StringRef Needed : Section.Needed) in writeSectionContent()
186 WasmYAML::LinkingSection &Section) { in writeSectionContent() argument
187 writeStringRef(Section.Name, OS); in writeSectionContent()
188 encodeULEB128(Section.Version, OS); in writeSectionContent()
193 if (Section.SymbolTable.size()) { in writeSectionContent()
195 encodeULEB128(Section.SymbolTable.size(), SubSection.getStream()); in writeSectionContent()
196 for (auto Sym : llvm::enumerate(Section.SymbolTable)) { in writeSectionContent()
231 if (Section.SegmentInfos.size()) { in writeSectionContent()
233 encodeULEB128(Section.SegmentInfos.size(), SubSection.getStream()); in writeSectionContent()
234 for (const WasmYAML::SegmentInfo &SegmentInfo : Section.SegmentInfos) { in writeSectionContent()
243 if (Section.InitFunctions.size()) { in writeSectionContent()
245 encodeULEB128(Section.InitFunctions.size(), SubSection.getStream()); in writeSectionContent()
246 for (const WasmYAML::InitFunction &Func : Section.InitFunctions) { in writeSectionContent()
254 if (Section.Comdats.size()) { in writeSectionContent()
256 encodeULEB128(Section.Comdats.size(), SubSection.getStream()); in writeSectionContent()
257 for (const auto &C : Section.Comdats) { in writeSectionContent()
271 WasmYAML::NameSection &Section) { in writeSectionContent() argument
272 writeStringRef(Section.Name, OS); in writeSectionContent()
273 if (Section.FunctionNames.size()) { in writeSectionContent()
278 encodeULEB128(Section.FunctionNames.size(), SubSection.getStream()); in writeSectionContent()
279 for (const WasmYAML::NameEntry &NameEntry : Section.FunctionNames) { in writeSectionContent()
286 if (Section.GlobalNames.size()) { in writeSectionContent()
291 encodeULEB128(Section.GlobalNames.size(), SubSection.getStream()); in writeSectionContent()
292 for (const WasmYAML::NameEntry &NameEntry : Section.GlobalNames) { in writeSectionContent()
299 if (Section.DataSegmentNames.size()) { in writeSectionContent()
304 encodeULEB128(Section.DataSegmentNames.size(), SubSection.getStream()); in writeSectionContent()
305 for (const WasmYAML::NameEntry &NameEntry : Section.DataSegmentNames) { in writeSectionContent()
315 WasmYAML::ProducersSection &Section) { in writeSectionContent() argument
316 writeStringRef(Section.Name, OS); in writeSectionContent()
317 int Fields = int(!Section.Languages.empty()) + int(!Section.Tools.empty()) + in writeSectionContent()
318 int(!Section.SDKs.empty()); in writeSectionContent()
322 for (auto &Field : {std::make_pair(StringRef("language"), &Section.Languages), in writeSectionContent()
323 std::make_pair(StringRef("processed-by"), &Section.Tools), in writeSectionContent()
324 std::make_pair(StringRef("sdk"), &Section.SDKs)}) { in writeSectionContent()
337 WasmYAML::TargetFeaturesSection &Section) { in writeSectionContent() argument
338 writeStringRef(Section.Name, OS); in writeSectionContent()
339 encodeULEB128(Section.Features.size(), OS); in writeSectionContent()
340 for (auto &E : Section.Features) { in writeSectionContent()
347 WasmYAML::CustomSection &Section) { in writeSectionContent() argument
348 if (auto S = dyn_cast<WasmYAML::DylinkSection>(&Section)) { in writeSectionContent()
350 } else if (auto S = dyn_cast<WasmYAML::NameSection>(&Section)) { in writeSectionContent()
352 } else if (auto S = dyn_cast<WasmYAML::LinkingSection>(&Section)) { in writeSectionContent()
354 } else if (auto S = dyn_cast<WasmYAML::ProducersSection>(&Section)) { in writeSectionContent()
356 } else if (auto S = dyn_cast<WasmYAML::TargetFeaturesSection>(&Section)) { in writeSectionContent()
359 writeStringRef(Section.Name, OS); in writeSectionContent()
360 Section.Payload.writeAsBinary(OS); in writeSectionContent()
365 WasmYAML::TypeSection &Section) { in writeSectionContent() argument
366 encodeULEB128(Section.Signatures.size(), OS); in writeSectionContent()
368 for (const WasmYAML::Signature &Sig : Section.Signatures) { in writeSectionContent()
385 WasmYAML::ImportSection &Section) { in writeSectionContent() argument
386 encodeULEB128(Section.Imports.size(), OS); in writeSectionContent()
387 for (const WasmYAML::Import &Import : Section.Imports) { in writeSectionContent()
422 WasmYAML::FunctionSection &Section) { in writeSectionContent() argument
423 encodeULEB128(Section.FunctionTypes.size(), OS); in writeSectionContent()
424 for (uint32_t FuncType : Section.FunctionTypes) in writeSectionContent()
429 WasmYAML::ExportSection &Section) { in writeSectionContent() argument
430 encodeULEB128(Section.Exports.size(), OS); in writeSectionContent()
431 for (const WasmYAML::Export &Export : Section.Exports) { in writeSectionContent()
439 WasmYAML::StartSection &Section) { in writeSectionContent() argument
440 encodeULEB128(Section.StartFunction, OS); in writeSectionContent()
444 WasmYAML::TableSection &Section) { in writeSectionContent() argument
445 encodeULEB128(Section.Tables.size(), OS); in writeSectionContent()
447 for (auto &Table : Section.Tables) { in writeSectionContent()
459 WasmYAML::MemorySection &Section) { in writeSectionContent() argument
460 encodeULEB128(Section.Memories.size(), OS); in writeSectionContent()
461 for (const WasmYAML::Limits &Mem : Section.Memories) in writeSectionContent()
466 WasmYAML::TagSection &Section) { in writeSectionContent() argument
467 encodeULEB128(Section.TagTypes.size(), OS); in writeSectionContent()
468 for (uint32_t TagType : Section.TagTypes) { in writeSectionContent()
475 WasmYAML::GlobalSection &Section) { in writeSectionContent() argument
476 encodeULEB128(Section.Globals.size(), OS); in writeSectionContent()
478 for (auto &Global : Section.Globals) { in writeSectionContent()
491 WasmYAML::ElemSection &Section) { in writeSectionContent() argument
492 encodeULEB128(Section.Segments.size(), OS); in writeSectionContent()
493 for (auto &Segment : Section.Segments) { in writeSectionContent()
519 WasmYAML::CodeSection &Section) { in writeSectionContent() argument
520 encodeULEB128(Section.Functions.size(), OS); in writeSectionContent()
522 for (auto &Func : Section.Functions) { in writeSectionContent()
539 // Write the section size followed by the content in writeSectionContent()
547 WasmYAML::DataSection &Section) { in writeSectionContent() argument
548 encodeULEB128(Section.Segments.size(), OS); in writeSectionContent()
549 for (auto &Segment : Section.Segments) { in writeSectionContent()
561 WasmYAML::DataCountSection &Section) { in writeSectionContent() argument
562 encodeULEB128(Section.Count, OS); in writeSectionContent()
565 void WasmWriter::writeRelocSection(raw_ostream &OS, WasmYAML::Section &Sec, in writeRelocSection()
600 // Write each section in writeWasm()
602 for (const std::unique_ptr<WasmYAML::Section> &Sec : Obj.Sections) { in writeWasm()
607 reportError("out of order section type: " + Twine(Sec->Type)); in writeWasm()
642 reportError("unknown section type: " + Twine(Sec->Type)); in writeWasm()
655 reportError("section header length can't be encoded in a LEB of size " + in writeWasm()
659 // Write the section size followed by the content in writeWasm()
664 // write reloc sections for any section that have relocations in writeWasm()
666 for (const std::unique_ptr<WasmYAML::Section> &Sec : Obj.Sections) { in writeWasm()