aboutsummaryrefslogtreecommitdiff
path: root/lld/wasm/InputFiles.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:43:11 +0900
committerNAKAMURA Takumi <geek4civic@gmail.com>2025-01-09 18:43:11 +0900
commit0e1a753549b29ff1f5a190aca83b803a33b51628 (patch)
treee5578f8810c65711304128d0c8add7fa1f77b9d8 /lld/wasm/InputFiles.cpp
parent3c6252260ee11e3a453076b4d96ffffe20d49998 (diff)
parentbdcf47e4bcb92889665825654bb80a8bbe30379e (diff)
downloadllvm-users/chapuni/cov/single/if.zip
llvm-users/chapuni/cov/single/if.tar.gz
llvm-users/chapuni/cov/single/if.tar.bz2
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/ifusers/chapuni/cov/single/if
Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
Diffstat (limited to 'lld/wasm/InputFiles.cpp')
-rw-r--r--lld/wasm/InputFiles.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 221f02a..614cddd 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -47,7 +47,7 @@ std::string toString(const wasm::InputFile *file) {
namespace wasm {
std::string replaceThinLTOSuffix(StringRef path) {
- auto [suffix, repl] = config->thinLTOObjectSuffixReplace;
+ auto [suffix, repl] = ctx.arg.thinLTOObjectSuffixReplace;
if (path.consume_back(suffix))
return (path + repl).str();
return std::string(path);
@@ -55,10 +55,10 @@ std::string replaceThinLTOSuffix(StringRef path) {
void InputFile::checkArch(Triple::ArchType arch) const {
bool is64 = arch == Triple::wasm64;
- if (is64 && !config->is64) {
+ if (is64 && !ctx.arg.is64) {
fatal(toString(this) +
": must specify -mwasm64 to process wasm64 object files");
- } else if (config->is64.value_or(false) != is64) {
+ } else if (ctx.arg.is64.value_or(false) != is64) {
fatal(toString(this) +
": wasm32 object file can't be linked in wasm64 mode");
}
@@ -169,7 +169,7 @@ uint64_t ObjFile::calcNewValue(const WasmRelocation &reloc, uint64_t tombstone,
uint32_t index = getFunctionSymbol(reloc.Index)->getTableIndex();
if (reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB ||
reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB64)
- index -= config->tableBase;
+ index -= ctx.arg.tableBase;
return index;
}
case R_WASM_MEMORY_ADDR_LEB:
@@ -360,7 +360,7 @@ void ObjFile::addLegacyIndirectFunctionTableIfNeeded(
}
static bool shouldMerge(const WasmSection &sec) {
- if (config->optimize == 0)
+ if (ctx.arg.optimize == 0)
return false;
// Sadly we don't have section attributes yet for custom sections, so we
// currently go by the name alone.
@@ -383,7 +383,7 @@ static bool shouldMerge(const WasmSegment &seg) {
// On a regular link we don't merge sections if -O0 (default is -O1). This
// sometimes makes the linker significantly faster, although the output will
// be bigger.
- if (config->optimize == 0)
+ if (ctx.arg.optimize == 0)
return false;
// A mergeable section with size 0 is useless because they don't have
@@ -845,7 +845,7 @@ BitcodeFile::BitcodeFile(MemoryBufferRef m, StringRef archiveName,
this->archiveName = std::string(archiveName);
std::string path = mb.getBufferIdentifier().str();
- if (config->thinLTOIndexOnly)
+ if (ctx.arg.thinLTOIndexOnly)
path = replaceThinLTOSuffix(mb.getBufferIdentifier());
// ThinLTO assumes that all MemoryBufferRefs given to it have a unique