aboutsummaryrefslogtreecommitdiff
path: root/lld/wasm/SymbolTable.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:15:55 +0900
committerNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:15:55 +0900
commitbdcf47e4bcb92889665825654bb80a8bbe30379e (patch)
tree4de1d6b4ddc69f4f32daabb11ad5c71ab0cf895e /lld/wasm/SymbolTable.cpp
parente7fd5cd25334048980ea207a9eff72698724721a (diff)
parentfea7da1b00cc97d742faede2df96c7d327950f49 (diff)
downloadllvm-users/chapuni/cov/single/base.zip
llvm-users/chapuni/cov/single/base.tar.gz
llvm-users/chapuni/cov/single/base.tar.bz2
Merge branch 'users/chapuni/cov/single/nextcount' into users/chapuni/cov/single/baseusers/chapuni/cov/single/base
Diffstat (limited to 'lld/wasm/SymbolTable.cpp')
-rw-r--r--lld/wasm/SymbolTable.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index 4cbf44b..f573590 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -53,7 +53,7 @@ void SymbolTable::addFile(InputFile *file, StringRef symName) {
return;
}
- if (config->trace)
+ if (ctx.arg.trace)
message(toString(file));
// LLVM bitcode file
@@ -125,7 +125,7 @@ std::pair<Symbol *, bool> SymbolTable::insertName(StringRef name) {
sym->canInline = true;
sym->traced = trace;
sym->forceExport = false;
- sym->referenced = !config->gcSections;
+ sym->referenced = !ctx.arg.gcSections;
symVector.emplace_back(sym);
return {sym, true};
}
@@ -235,7 +235,7 @@ DefinedFunction *SymbolTable::addSyntheticFunction(StringRef name,
DefinedData *SymbolTable::addOptionalDataSymbol(StringRef name,
uint64_t value) {
Symbol *s = find(name);
- if (!s && (config->exportAll || config->exportedSymbols.count(name) != 0))
+ if (!s && (ctx.arg.exportAll || ctx.arg.exportedSymbols.count(name) != 0))
s = insertName(name).first;
else if (!s || s->isDefined())
return nullptr;
@@ -317,7 +317,7 @@ static bool shouldReplace(const Symbol *existing, InputFile *newFile,
}
// Neither symbol is week. They conflict.
- if (config->allowMultipleDefinition)
+ if (ctx.arg.allowMultipleDefinition)
return false;
errorOrWarn("duplicate symbol: " + toString(*existing) + "\n>>> defined in " +
@@ -387,7 +387,7 @@ Symbol *SymbolTable::addSharedFunction(StringRef name, uint32_t flags,
checkSig = ud->isCalledDirectly;
if (checkSig && !signatureMatches(existingFunction, sig)) {
- if (config->shlibSigCheck) {
+ if (ctx.arg.shlibSigCheck) {
reportFunctionSignatureMismatch(name, existingFunction, sig, file);
} else {
// With --no-shlib-sigcheck we ignore the signature of the function as
@@ -637,7 +637,7 @@ Symbol *SymbolTable::addUndefinedFunction(StringRef name,
lazy->signature = sig;
} else {
lazy->extract();
- if (!config->whyExtract.empty())
+ if (!ctx.arg.whyExtract.empty())
ctx.whyExtractRecords.emplace_back(toString(file), s->getFile(), *s);
}
} else {
@@ -652,7 +652,7 @@ Symbol *SymbolTable::addUndefinedFunction(StringRef name,
if (isCalledDirectly && !signatureMatches(existingFunction, sig)) {
if (existingFunction->isShared()) {
// Special handling for when the existing function is a shared symbol
- if (config->shlibSigCheck) {
+ if (ctx.arg.shlibSigCheck) {
reportFunctionSignatureMismatch(name, existingFunction, sig, file);
} else {
existingFunction->signature = sig;
@@ -788,12 +788,12 @@ TableSymbol *SymbolTable::createUndefinedIndirectFunctionTable(StringRef name) {
WasmTableType *type = make<WasmTableType>();
type->ElemType = ValType::FUNCREF;
type->Limits = limits;
- uint32_t flags = config->exportTable ? 0 : WASM_SYMBOL_VISIBILITY_HIDDEN;
+ uint32_t flags = ctx.arg.exportTable ? 0 : WASM_SYMBOL_VISIBILITY_HIDDEN;
flags |= WASM_SYMBOL_UNDEFINED;
Symbol *sym =
addUndefinedTable(name, name, defaultModule, flags, nullptr, type);
sym->markLive();
- sym->forceExport = config->exportTable;
+ sym->forceExport = ctx.arg.exportTable;
return cast<TableSymbol>(sym);
}
@@ -803,10 +803,10 @@ TableSymbol *SymbolTable::createDefinedIndirectFunctionTable(StringRef name) {
WasmTableType type{ValType::FUNCREF, limits};
WasmTable desc{invalidIndex, type, name};
InputTable *table = make<InputTable>(desc, nullptr);
- uint32_t flags = config->exportTable ? 0 : WASM_SYMBOL_VISIBILITY_HIDDEN;
+ uint32_t flags = ctx.arg.exportTable ? 0 : WASM_SYMBOL_VISIBILITY_HIDDEN;
TableSymbol *sym = addSyntheticTable(name, flags, table);
sym->markLive();
- sym->forceExport = config->exportTable;
+ sym->forceExport = ctx.arg.exportTable;
return sym;
}
@@ -830,7 +830,7 @@ TableSymbol *SymbolTable::resolveIndirectFunctionTable(bool required) {
}
}
- if (config->importTable) {
+ if (ctx.arg.importTable) {
if (existing) {
existing->importModule = defaultModule;
existing->importName = functionTableName;
@@ -838,7 +838,7 @@ TableSymbol *SymbolTable::resolveIndirectFunctionTable(bool required) {
}
if (required)
return createUndefinedIndirectFunctionTable(functionTableName);
- } else if ((existing && existing->isLive()) || config->exportTable ||
+ } else if ((existing && existing->isLive()) || ctx.arg.exportTable ||
required) {
// A defined table is required. Either because the user request an exported
// table or because the table symbol is already live. The existing table is
@@ -885,7 +885,7 @@ void SymbolTable::addLazy(StringRef name, InputFile *file) {
LLVM_DEBUG(dbgs() << "replacing existing undefined\n");
const InputFile *oldFile = s->getFile();
LazySymbol(name, 0, file).extract();
- if (!config->whyExtract.empty())
+ if (!ctx.arg.whyExtract.empty())
ctx.whyExtractRecords.emplace_back(toString(oldFile), s->getFile(), *s);
}