summaryrefslogtreecommitdiffstats
path: root/lld/wasm/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/SyntheticSections.cpp')
-rw-r--r--lld/wasm/SyntheticSections.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp
index 30c1096e16c..ba04543211c 100644
--- a/lld/wasm/SyntheticSections.cpp
+++ b/lld/wasm/SyntheticSections.cpp
@@ -365,6 +365,12 @@ void ElemSection::writeBody() {
}
}
+DataCountSection::DataCountSection(ArrayRef<OutputSegment *> segments)
+ : SyntheticSection(llvm::wasm::WASM_SEC_DATACOUNT),
+ numSegments(std::count_if(
+ segments.begin(), segments.end(),
+ [](OutputSegment *const segment) { return !segment->isBss; })) {}
+
void DataCountSection::writeBody() {
writeUleb128(bodyOutputStream, numSegments, "data count");
}
OpenPOWER on IntegriCloud