diff options
| author | Sam Clegg <sbc@chromium.org> | 2018-01-13 15:44:54 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2018-01-13 15:44:54 +0000 |
| commit | 7c11dbf5b09b5a91587c2b744ef52fa810992ee4 (patch) | |
| tree | 90be40d9d14e9665b308b8d968b7e4d32a40672e /lld/wasm/OutputSegment.h | |
| parent | 4158eff0f84781e5449961b5544a2eb441f8a26e (diff) | |
| download | bcm5719-llvm-7c11dbf5b09b5a91587c2b744ef52fa810992ee4.tar.gz bcm5719-llvm-7c11dbf5b09b5a91587c2b744ef52fa810992ee4.zip | |
[WebAssembly] Move checking of InputSegment comdat group earlier
This should also fixe an unused varaible warning in the realeae
build.
llvm-svn: 322440
Diffstat (limited to 'lld/wasm/OutputSegment.h')
| -rw-r--r-- | lld/wasm/OutputSegment.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/wasm/OutputSegment.h b/lld/wasm/OutputSegment.h index 9825ce8e697..420d9744165 100644 --- a/lld/wasm/OutputSegment.h +++ b/lld/wasm/OutputSegment.h @@ -25,12 +25,18 @@ public: void addInputSegment(InputSegment *Segment) { Alignment = std::max(Alignment, Segment->getAlignment()); + if (InputSegments.empty()) + Comdat = Segment->getComdat(); + else + assert(Comdat == Segment->getComdat()); InputSegments.push_back(Segment); Size = llvm::alignTo(Size, Segment->getAlignment()); Segment->setOutputSegment(this, Size); Size += Segment->getSize(); } + StringRef getComdat() const { return Comdat; } + uint32_t getSectionOffset() const { return SectionOffset; } void setSectionOffset(uint32_t Offset) { SectionOffset = Offset; } @@ -47,6 +53,7 @@ public: std::string Header; private: + StringRef Comdat; uint32_t SectionOffset = 0; }; |

