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