diff options
| author | Fangrui Song <i@maskray.me> | 2024-09-21 22:54:37 -0700 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2024-09-21 22:54:37 -0700 |
| commit | a7e14e24876a9f6465a719c759dad5e4905417cd (patch) | |
| tree | 31f456c05a55a56fa06cf9f55d47ab434c17ee9b | |
| parent | 6f482010aeb921437193ef5c8884f743ec7cb360 (diff) | |
| download | llvm-a7e14e24876a9f6465a719c759dad5e4905417cd.zip llvm-a7e14e24876a9f6465a719c759dad5e4905417cd.tar.gz llvm-a7e14e24876a9f6465a719c759dad5e4905417cd.tar.bz2 | |
[ELF] Replace config-> with ctx.arg.
| -rw-r--r-- | lld/ELF/DWARF.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/DriverUtils.cpp | 12 | ||||
| -rw-r--r-- | lld/ELF/EhFrame.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/LTO.cpp | 10 |
4 files changed, 13 insertions, 13 deletions
diff --git a/lld/ELF/DWARF.cpp b/lld/ELF/DWARF.cpp index 517d268..133e66ba 100644 --- a/lld/ELF/DWARF.cpp +++ b/lld/ELF/DWARF.cpp @@ -112,7 +112,7 @@ LLDDwarfObj<ELFT>::findAux(const InputSectionBase &sec, uint64_t pos, const RelTy &rel = *it; const ObjFile<ELFT> *file = sec.getFile<ELFT>(); - uint32_t symIndex = rel.getSymbol(config->isMips64EL); + uint32_t symIndex = rel.getSymbol(ctx.arg.isMips64EL); const typename ELFT::Sym &sym = file->template getELFSyms<ELFT>()[symIndex]; uint32_t secIndex = file->getSectionIndex(sym); diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp index ac74604..f001f2c 100644 --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -137,7 +137,7 @@ opt::InputArgList ELFOptTable::parse(ArrayRef<const char *> argv) { void elf::printHelp() { ELFOptTable().printHelp( - lld::outs(), (config->progName + " [options] file...").str().c_str(), + lld::outs(), (ctx.arg.progName + " [options] file...").str().c_str(), "lld", false /*ShowHidden*/, true /*ShowAllAliases*/); lld::outs() << "\n"; @@ -145,7 +145,7 @@ void elf::printHelp() { // targets:.* elf/ in a message for the --help option. If it doesn't match, // the scripts assume that the linker doesn't support very basic features // such as shared libraries. Therefore, we need to print out at least "elf". - lld::outs() << config->progName << ": supported targets: elf\n"; + lld::outs() << ctx.arg.progName << ": supported targets: elf\n"; } static std::string rewritePath(StringRef s) { @@ -214,7 +214,7 @@ static std::optional<std::string> findFile(StringRef path1, const Twine &path2) { SmallString<128> s; if (path1.starts_with("=")) - path::append(s, config->sysroot, path1.substr(1), path2); + path::append(s, ctx.arg.sysroot, path1.substr(1), path2); else path::append(s, path1, path2); @@ -224,7 +224,7 @@ static std::optional<std::string> findFile(StringRef path1, } std::optional<std::string> elf::findFromSearchPaths(StringRef path) { - for (StringRef dir : config->searchPaths) + for (StringRef dir : ctx.arg.searchPaths) if (std::optional<std::string> s = findFile(dir, path)) return s; return std::nullopt; @@ -233,8 +233,8 @@ std::optional<std::string> elf::findFromSearchPaths(StringRef path) { // This is for -l<basename>. We'll look for lib<basename>.so or lib<basename>.a from // search paths. std::optional<std::string> elf::searchLibraryBaseName(StringRef name) { - for (StringRef dir : config->searchPaths) { - if (!config->isStatic) + for (StringRef dir : ctx.arg.searchPaths) { + if (!ctx.arg.isStatic) if (std::optional<std::string> s = findFile(dir, "lib" + name + ".so")) return s; if (std::optional<std::string> s = findFile(dir, "lib" + name + ".a")) diff --git a/lld/ELF/EhFrame.cpp b/lld/ELF/EhFrame.cpp index db58c54..efedbd3 100644 --- a/lld/ELF/EhFrame.cpp +++ b/lld/ELF/EhFrame.cpp @@ -101,7 +101,7 @@ static size_t getAugPSize(unsigned enc) { switch (enc & 0x0f) { case DW_EH_PE_absptr: case DW_EH_PE_signed: - return config->wordsize; + return ctx.arg.wordsize; case DW_EH_PE_udata2: case DW_EH_PE_sdata2: return 2; diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 6f5c320..1dca824 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -214,9 +214,9 @@ BitcodeCompiler::~BitcodeCompiler() = default; void BitcodeCompiler::add(BitcodeFile &f) { lto::InputFile &obj = *f.obj; - bool isExec = !config->shared && !config->relocatable; + bool isExec = !ctx.arg.shared && !ctx.arg.relocatable; - if (config->thinLTOEmitIndexFiles) + if (ctx.arg.thinLTOEmitIndexFiles) thinIndices.insert(obj.getName()); ArrayRef<Symbol *> syms = f.getSymbols(); @@ -244,7 +244,7 @@ void BitcodeCompiler::add(BitcodeFile &f) { // 4) Symbols that are defined in bitcode files and used for dynamic // linking. // 5) Symbols that will be referenced after linker wrapping is performed. - r.VisibleToRegularObj = config->relocatable || sym->isUsedInRegularObj || + r.VisibleToRegularObj = ctx.arg.relocatable || sym->isUsedInRegularObj || sym->referencedAfterWrap || (r.Prevailing && sym->includeInDynsym()) || usedStartStop.count(objSym.getSectionName()); @@ -252,7 +252,7 @@ void BitcodeCompiler::add(BitcodeFile &f) { // referenced by a shared library not visible to the linker. r.ExportDynamic = sym->computeBinding() != STB_LOCAL && - (config->exportDynamic || sym->exportDynamic || sym->inDynamicList); + (ctx.arg.exportDynamic || sym->exportDynamic || sym->inDynamicList); const auto *dr = dyn_cast<Defined>(sym); r.FinalDefinitionInLinkageUnit = (isExec || sym->visibility() != STV_DEFAULT) && dr && @@ -299,7 +299,7 @@ static void thinLTOCreateEmptyIndexFiles() { ModuleSummaryIndex m(/*HaveGVs*/ false); m.setSkipModuleByDistributedBackend(); writeIndexToFile(m, *os); - if (config->thinLTOEmitImportsFiles) + if (ctx.arg.thinLTOEmitImportsFiles) openFile(path + ".imports"); } } |
