aboutsummaryrefslogtreecommitdiff
path: root/lld/wasm/SyntheticSections.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/SyntheticSections.h')
-rw-r--r--lld/wasm/SyntheticSections.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/wasm/SyntheticSections.h b/lld/wasm/SyntheticSections.h
index 10183e9..068fbed 100644
--- a/lld/wasm/SyntheticSections.h
+++ b/lld/wasm/SyntheticSections.h
@@ -228,7 +228,7 @@ class MemorySection : public SyntheticSection {
public:
MemorySection() : SyntheticSection(llvm::wasm::WASM_SEC_MEMORY) {}
- bool isNeeded() const override { return !config->memoryImport.has_value(); }
+ bool isNeeded() const override { return !ctx.arg.memoryImport.has_value(); }
void writeBody() override;
uint64_t numMemoryPages = 0;
@@ -286,7 +286,7 @@ public:
// transform a `global.get` to an `i32.const`.
void addInternalGOTEntry(Symbol *sym);
bool needsRelocations() {
- if (config->extendedConst)
+ if (ctx.arg.extendedConst)
return false;
return llvm::any_of(internalGotSymbols,
[=](Symbol *sym) { return !sym->isTLS(); });
@@ -354,7 +354,7 @@ public:
: SyntheticSection(llvm::wasm::WASM_SEC_CUSTOM, "linking"),
initFunctions(initFunctions), dataSegments(dataSegments) {}
bool isNeeded() const override {
- return config->relocatable || config->emitRelocs;
+ return ctx.arg.relocatable || ctx.arg.emitRelocs;
}
void writeBody() override;
void addToSymtab(Symbol *sym);
@@ -373,7 +373,7 @@ public:
: SyntheticSection(llvm::wasm::WASM_SEC_CUSTOM, "name"),
segments(segments) {}
bool isNeeded() const override {
- if (config->stripAll && !config->keepSections.count(name))
+ if (ctx.arg.stripAll && !ctx.arg.keepSections.count(name))
return false;
return numNames() > 0;
}
@@ -396,7 +396,7 @@ public:
ProducersSection()
: SyntheticSection(llvm::wasm::WASM_SEC_CUSTOM, "producers") {}
bool isNeeded() const override {
- if (config->stripAll && !config->keepSections.count(name))
+ if (ctx.arg.stripAll && !ctx.arg.keepSections.count(name))
return false;
return fieldCount() > 0;
}
@@ -417,7 +417,7 @@ public:
TargetFeaturesSection()
: SyntheticSection(llvm::wasm::WASM_SEC_CUSTOM, "target_features") {}
bool isNeeded() const override {
- if (config->stripAll && !config->keepSections.count(name))
+ if (ctx.arg.stripAll && !ctx.arg.keepSections.count(name))
return false;
return features.size() > 0;
}
@@ -443,7 +443,7 @@ public:
BuildIdSection();
void writeBody() override;
bool isNeeded() const override {
- return config->buildId != BuildIdKind::None;
+ return ctx.arg.buildId != BuildIdKind::None;
}
void writeBuildId(llvm::ArrayRef<uint8_t> buf);
void writeTo(uint8_t *buf) override {