diff options
| author | Sam Clegg <sbc@chromium.org> | 2018-01-09 23:56:44 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2018-01-09 23:56:44 +0000 |
| commit | 8d146bbc0cb3fcd00d036354da3fc00777450f0d (patch) | |
| tree | 8ce0d3fe05f5e2bf6e258b8d2f8f4eecc4b97425 /lld/wasm/InputSegment.h | |
| parent | 1f562176e9363e5b8b47bbfd6ea3b5051902a46e (diff) | |
| download | bcm5719-llvm-8d146bbc0cb3fcd00d036354da3fc00777450f0d.tar.gz bcm5719-llvm-8d146bbc0cb3fcd00d036354da3fc00777450f0d.zip | |
[WebAssembly] Output functions individually
The code section is now written out one function
at a time rather than all the functions in a given
objects being serialized at once.
This change lays the groundwork for supporting
--gc-sections.
Differential Revision: https://reviews.llvm.org/D41315
llvm-svn: 322138
Diffstat (limited to 'lld/wasm/InputSegment.h')
| -rw-r--r-- | lld/wasm/InputSegment.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lld/wasm/InputSegment.h b/lld/wasm/InputSegment.h index f70a3ded895..10ca8413d2c 100644 --- a/lld/wasm/InputSegment.h +++ b/lld/wasm/InputSegment.h @@ -36,7 +36,7 @@ class OutputSegment; class InputSegment { public: - InputSegment(const WasmSegment *Seg, const ObjFile *F) + InputSegment(const WasmSegment &Seg, const ObjFile &F) : Segment(Seg), File(F) {} // Translate an offset in the input segment to an offset in the output @@ -47,21 +47,21 @@ public: uint32_t getOutputSegmentOffset() const { return OutputSegmentOffset; } - uint32_t getInputSectionOffset() const { return Segment->SectionOffset; } + uint32_t getInputSectionOffset() const { return Segment.SectionOffset; } void setOutputSegment(const OutputSegment *Segment, uint32_t Offset) { OutputSeg = Segment; OutputSegmentOffset = Offset; } - uint32_t getSize() const { return Segment->Data.Content.size(); } - uint32_t getAlignment() const { return Segment->Data.Alignment; } - uint32_t startVA() const { return Segment->Data.Offset.Value.Int32; } + uint32_t getSize() const { return Segment.Data.Content.size(); } + uint32_t getAlignment() const { return Segment.Data.Alignment; } + uint32_t startVA() const { return Segment.Data.Offset.Value.Int32; } uint32_t endVA() const { return startVA() + getSize(); } - StringRef getName() const { return Segment->Data.Name; } + StringRef getName() const { return Segment.Data.Name; } - const WasmSegment *Segment; - const ObjFile *File; + const WasmSegment &Segment; + const ObjFile &File; std::vector<WasmRelocation> Relocations; std::vector<OutputRelocation> OutRelocations; |

