diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:31:57 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:33:27 +0900 |
commit | df025ebf872052c0761d44a3ef9b65e9675af8a8 (patch) | |
tree | 9b4e94583e2536546d6606270bcdf846c95e1ba2 /lld/wasm/SymbolTable.cpp | |
parent | 4428c9d0b1344179f85a72e183a44796976521e3 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/loop.zip llvm-users/chapuni/cov/single/loop.tar.gz llvm-users/chapuni/cov/single/loop.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/loopusers/chapuni/cov/single/loop
Conflicts:
clang/lib/CodeGen/CoverageMappingGen.cpp
Diffstat (limited to 'lld/wasm/SymbolTable.cpp')
-rw-r--r-- | lld/wasm/SymbolTable.cpp | 28 |
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); } |