diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-readobj/WasmDumper.cpp | 12 | ||||
-rw-r--r-- | llvm/tools/obj2yaml/wasm2yaml.cpp | 12 | ||||
-rw-r--r-- | llvm/tools/yaml2obj/yaml2wasm.cpp | 11 |
3 files changed, 1 insertions, 34 deletions
diff --git a/llvm/tools/llvm-readobj/WasmDumper.cpp b/llvm/tools/llvm-readobj/WasmDumper.cpp index 3be1f827f50..88fcbf61a6a 100644 --- a/llvm/tools/llvm-readobj/WasmDumper.cpp +++ b/llvm/tools/llvm-readobj/WasmDumper.cpp @@ -160,18 +160,6 @@ void WasmDumper::printSections() { W.printNumber("DataAlignment", LinkingData.DataAlignment); } break; - case wasm::WASM_SEC_DATA: { - ListScope Group(W, "Segments"); - for (const WasmSegment &Segment : Obj->dataSegments()) { - DictScope Group(W, "Segment"); - if (!Segment.Data.Name.empty()) - W.printString("Name", Segment.Data.Name); - W.printNumber("Size", Segment.Data.Content.size()); - if (Segment.Data.Offset.Opcode == wasm::WASM_OPCODE_I32_CONST) - W.printNumber("Offset", Segment.Data.Offset.Value.Int32); - } - break; - } case wasm::WASM_SEC_MEMORY: ListScope Group(W, "Memories"); for (const wasm::WasmLimits &Memory : Obj->memories()) { diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp index 8b2a0adf73f..a1da4b6a748 100644 --- a/llvm/tools/obj2yaml/wasm2yaml.cpp +++ b/llvm/tools/obj2yaml/wasm2yaml.cpp @@ -70,16 +70,6 @@ std::unique_ptr<WasmYAML::CustomSection> WasmDumper::dumpCustomSection(const Was CustomSec = std::move(NameSec); } else if (WasmSec.Name == "linking") { std::unique_ptr<WasmYAML::LinkingSection> LinkingSec = make_unique<WasmYAML::LinkingSection>(); - 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); - } - Index++; - } for (const object::SymbolRef& Sym: Obj.symbols()) { const object::WasmSymbol Symbol = Obj.getWasmSymbol(Sym); if (Symbol.Flags != 0) { @@ -244,7 +234,7 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() { } case wasm::WASM_SEC_DATA: { auto DataSec = make_unique<WasmYAML::DataSection>(); - for (const object::WasmSegment &Segment : Obj.dataSegments()) { + for (auto &Segment : Obj.dataSegments()) { WasmYAML::DataSegment Seg; Seg.SectionOffset = Segment.SectionOffset; Seg.MemoryIndex = Segment.Data.MemoryIndex; diff --git a/llvm/tools/yaml2obj/yaml2wasm.cpp b/llvm/tools/yaml2obj/yaml2wasm.cpp index 9dd7564720a..0bd882911f9 100644 --- a/llvm/tools/yaml2obj/yaml2wasm.cpp +++ b/llvm/tools/yaml2obj/yaml2wasm.cpp @@ -157,17 +157,6 @@ int WasmWriter::writeSectionContent(raw_ostream &OS, WasmYAML::LinkingSection &S SubSection.Done(); } - - // SEGMENT_NAMES subsection - if (Section.SegmentNames.size()) { - encodeULEB128(wasm::WASM_SEGMENT_NAMES, OS); - encodeULEB128(Section.SegmentNames.size(), SubSection.GetStream()); - for (const WasmYAML::NameEntry &NameEntry : Section.SegmentNames) { - encodeULEB128(NameEntry.Index, SubSection.GetStream()); - writeStringRef(NameEntry.Name, SubSection.GetStream()); - } - SubSection.Done(); - } return 0; } |