forked from OSchip/llvm-project
Revert "[WebAssembly] Move checking of InputSegment comdat group earlier"
This reverts commit 7421eab7ccf2e14518f4526a084a5afc76ac9c6a. llvm-svn: 322441
This commit is contained in:
parent
7c11dbf5b0
commit
f98bccf06f
|
|
@ -25,18 +25,12 @@ public:
|
||||||
|
|
||||||
void addInputSegment(InputSegment *Segment) {
|
void addInputSegment(InputSegment *Segment) {
|
||||||
Alignment = std::max(Alignment, Segment->getAlignment());
|
Alignment = std::max(Alignment, Segment->getAlignment());
|
||||||
if (InputSegments.empty())
|
|
||||||
Comdat = Segment->getComdat();
|
|
||||||
else
|
|
||||||
assert(Comdat == Segment->getComdat());
|
|
||||||
InputSegments.push_back(Segment);
|
InputSegments.push_back(Segment);
|
||||||
Size = llvm::alignTo(Size, Segment->getAlignment());
|
Size = llvm::alignTo(Size, Segment->getAlignment());
|
||||||
Segment->setOutputSegment(this, Size);
|
Segment->setOutputSegment(this, Size);
|
||||||
Size += Segment->getSize();
|
Size += Segment->getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
StringRef getComdat() const { return Comdat; }
|
|
||||||
|
|
||||||
uint32_t getSectionOffset() const { return SectionOffset; }
|
uint32_t getSectionOffset() const { return SectionOffset; }
|
||||||
|
|
||||||
void setSectionOffset(uint32_t Offset) { SectionOffset = Offset; }
|
void setSectionOffset(uint32_t Offset) { SectionOffset = Offset; }
|
||||||
|
|
@ -53,7 +47,6 @@ public:
|
||||||
std::string Header;
|
std::string Header;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringRef Comdat;
|
|
||||||
uint32_t SectionOffset = 0;
|
uint32_t SectionOffset = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,12 @@ void Writer::createLinkingSection() {
|
||||||
ComdatEntry{WASM_COMDAT_FUNCTION, F->getOutputIndex()});
|
ComdatEntry{WASM_COMDAT_FUNCTION, F->getOutputIndex()});
|
||||||
}
|
}
|
||||||
for (uint32_t I = 0; I < Segments.size(); ++I) {
|
for (uint32_t I = 0; I < Segments.size(); ++I) {
|
||||||
StringRef Comdat = Segments[I]->getComdat();
|
const auto &InputSegments = Segments[I]->InputSegments;
|
||||||
|
if (InputSegments.empty())
|
||||||
|
continue;
|
||||||
|
StringRef Comdat = InputSegments[0]->getComdat();
|
||||||
|
for (const InputSegment *IS : InputSegments)
|
||||||
|
assert(IS->getComdat() == Comdat);
|
||||||
if (!Comdat.empty())
|
if (!Comdat.empty())
|
||||||
Comdats[Comdat].emplace_back(ComdatEntry{WASM_COMDAT_DATA, I});
|
Comdats[Comdat].emplace_back(ComdatEntry{WASM_COMDAT_DATA, I});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue