diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h index 18b7d28c0609..072eea607853 100644 --- a/lld/ELF/Config.h +++ b/lld/ELF/Config.h @@ -82,8 +82,8 @@ struct Configuration { llvm::StringRef Emulation; llvm::StringRef Fini; llvm::StringRef Init; - llvm::StringRef LtoAAPipeline; - llvm::StringRef LtoNewPmPasses; + llvm::StringRef LTOAAPipeline; + llvm::StringRef LTONewPmPasses; llvm::StringRef OutputFile; llvm::StringRef SoName; llvm::StringRef Sysroot; @@ -153,10 +153,10 @@ struct Configuration { uint64_t ImageBase; uint64_t MaxPageSize; uint64_t ZStackSize; - unsigned LtoPartitions; - unsigned LtoO; + unsigned LTOPartitions; + unsigned LTOO; unsigned Optimize; - unsigned ThinLtoJobs; + unsigned ThinLTOJobs; }; // The only instance of Configuration struct. diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 13d01b608774..5259082e7029 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -540,21 +540,21 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { Config->Entry = getString(Args, OPT_entry); Config->Fini = getString(Args, OPT_fini, "_fini"); Config->Init = getString(Args, OPT_init, "_init"); - Config->LtoAAPipeline = getString(Args, OPT_lto_aa_pipeline); - Config->LtoNewPmPasses = getString(Args, OPT_lto_newpm_passes); + Config->LTOAAPipeline = getString(Args, OPT_lto_aa_pipeline); + Config->LTONewPmPasses = getString(Args, OPT_lto_newpm_passes); Config->OutputFile = getString(Args, OPT_o); Config->SoName = getString(Args, OPT_soname); Config->Sysroot = getString(Args, OPT_sysroot); Config->Optimize = getInteger(Args, OPT_O, 1); - Config->LtoO = getInteger(Args, OPT_lto_O, 2); - if (Config->LtoO > 3) + Config->LTOO = getInteger(Args, OPT_lto_O, 2); + if (Config->LTOO > 3) error("invalid optimization level for LTO: " + getString(Args, OPT_lto_O)); - Config->LtoPartitions = getInteger(Args, OPT_lto_partitions, 1); - if (Config->LtoPartitions == 0) + Config->LTOPartitions = getInteger(Args, OPT_lto_partitions, 1); + if (Config->LTOPartitions == 0) error("--lto-partitions: number of threads must be > 0"); - Config->ThinLtoJobs = getInteger(Args, OPT_thinlto_jobs, -1u); - if (Config->ThinLtoJobs == 0) + Config->ThinLTOJobs = getInteger(Args, OPT_thinlto_jobs, -1u); + if (Config->ThinLTOJobs == 0) error("--thinlto-jobs: number of threads must be > 0"); Config->ZCombreloc = !hasZOption(Args, "nocombreloc"); @@ -794,7 +794,7 @@ template void LinkerDriver::link(opt::InputArgList &Args) { Symtab.scanDynamicList(); Symtab.scanVersionScript(); - Symtab.addCombinedLtoObject(); + Symtab.addCombinedLTOObject(); if (ErrorCount) return; diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 2621358a8b63..8d4ad9139477 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -75,24 +75,24 @@ static std::unique_ptr createLTO() { Conf.RelocModel = Config->Pic ? Reloc::PIC_ : Reloc::Static; Conf.DisableVerify = Config->DisableVerify; Conf.DiagHandler = diagnosticHandler; - Conf.OptLevel = Config->LtoO; + Conf.OptLevel = Config->LTOO; // Set up a custom pipeline if we've been asked to. - Conf.OptPipeline = Config->LtoNewPmPasses; - Conf.AAPipeline = Config->LtoAAPipeline; + Conf.OptPipeline = Config->LTONewPmPasses; + Conf.AAPipeline = Config->LTOAAPipeline; if (Config->SaveTemps) checkError(Conf.addSaveTemps(std::string(Config->OutputFile) + ".", /*UseInputModulePath*/ true)); lto::ThinBackend Backend; - if (Config->ThinLtoJobs != -1u) - Backend = lto::createInProcessThinBackend(Config->ThinLtoJobs); + if (Config->ThinLTOJobs != -1u) + Backend = lto::createInProcessThinBackend(Config->ThinLTOJobs); return llvm::make_unique(std::move(Conf), Backend, - Config->LtoPartitions); + Config->LTOPartitions); } -BitcodeCompiler::BitcodeCompiler() : LtoObj(createLTO()) {} +BitcodeCompiler::BitcodeCompiler() : LTOObj(createLTO()) {} BitcodeCompiler::~BitcodeCompiler() = default; @@ -128,17 +128,17 @@ void BitcodeCompiler::add(BitcodeFile &F) { if (R.Prevailing) undefine(Sym); } - checkError(LtoObj->add(std::move(F.Obj), Resols)); + checkError(LTOObj->add(std::move(F.Obj), Resols)); } // Merge all the bitcode files we have seen, codegen the result // and return the resulting ObjectFile(s). std::vector BitcodeCompiler::compile() { std::vector Ret; - unsigned MaxTasks = LtoObj->getMaxTasks(); + unsigned MaxTasks = LTOObj->getMaxTasks(); Buff.resize(MaxTasks); - checkError(LtoObj->run([&](size_t Task) { + checkError(LTOObj->run([&](size_t Task) { return llvm::make_unique( llvm::make_unique(Buff[Task])); })); diff --git a/lld/ELF/LTO.h b/lld/ELF/LTO.h index 7a91957fec52..b3d734f2d381 100644 --- a/lld/ELF/LTO.h +++ b/lld/ELF/LTO.h @@ -47,7 +47,7 @@ public: std::vector compile(); private: - std::unique_ptr LtoObj; + std::unique_ptr LTOObj; std::vector> Buff; }; } diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index bbeb4f6bde8a..6b96676921ff 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -108,16 +108,16 @@ template void SymbolTable::addFile(InputFile *File) { // using LLVM functions and replaces bitcode symbols with the results. // Because all bitcode files that consist of a program are passed // to the compiler at once, it can do whole-program optimization. -template void SymbolTable::addCombinedLtoObject() { +template void SymbolTable::addCombinedLTOObject() { if (BitcodeFiles.empty()) return; // Compile bitcode files and replace bitcode symbols. - Lto.reset(new BitcodeCompiler); + LTO.reset(new BitcodeCompiler); for (BitcodeFile *F : BitcodeFiles) - Lto->add(*F); + LTO->add(*F); - for (InputFile *File : Lto->compile()) { + for (InputFile *File : LTO->compile()) { ObjectFile *Obj = cast>(File); DenseSet DummyGroups; Obj->parse(DummyGroups); diff --git a/lld/ELF/SymbolTable.h b/lld/ELF/SymbolTable.h index bb4e371df82e..f37cce1a4f0c 100644 --- a/lld/ELF/SymbolTable.h +++ b/lld/ELF/SymbolTable.h @@ -42,7 +42,7 @@ template class SymbolTable { public: void addFile(InputFile *File); - void addCombinedLtoObject(); + void addCombinedLTOObject(); ArrayRef getSymbols() const { return SymVector; } ArrayRef *> getObjectFiles() const { return ObjectFiles; } @@ -141,7 +141,7 @@ private: llvm::Optional>> DemangledSyms; // For LTO. - std::unique_ptr Lto; + std::unique_ptr LTO; }; template struct Symtab { static SymbolTable *X; };