diff options
| author | Fangrui Song <i@maskray.me> | 2024-09-21 09:35:01 -0700 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2024-09-21 09:35:01 -0700 |
| commit | 0f57d5e19a1a9fe617a3513163a7777f0bf5dea5 (patch) | |
| tree | 423269cd0c2be55fbf7662ca3cf2d5c6f3cf498f /lld/ELF/Driver.cpp | |
| parent | 18225c783a00bde62f19a177a57de388e20c2bba (diff) | |
| download | llvm-users/MaskRay/spr/elf-add-thinlto-index.zip llvm-users/MaskRay/spr/elf-add-thinlto-index.tar.gz llvm-users/MaskRay/spr/elf-add-thinlto-index.tar.bz2 | |
[𝘀𝗽𝗿] initial versionusers/MaskRay/spr/elf-add-thinlto-index
Created using spr 1.3.5-bogner
Diffstat (limited to 'lld/ELF/Driver.cpp')
| -rw-r--r-- | lld/ELF/Driver.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index e25db0e..e7b3466 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1449,10 +1449,13 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) { parseCachePruningPolicy(args.getLastArgValue(OPT_thinlto_cache_policy)), "--thinlto-cache-policy: invalid cache policy"); ctx.arg.thinLTOEmitImportsFiles = args.hasArg(OPT_thinlto_emit_imports_files); - ctx.arg.thinLTOEmitIndexFiles = args.hasArg(OPT_thinlto_emit_index_files) || + ctx.arg.thinLTOIndex = args.getLastArgValue(OPT_thinlto_index); + ctx.arg.thinLTOEmitIndexFiles = ctx.arg.thinLTOIndex.size() || + args.hasArg(OPT_thinlto_emit_index_files) || args.hasArg(OPT_thinlto_index_only) || args.hasArg(OPT_thinlto_index_only_eq); - ctx.arg.thinLTOIndexOnly = args.hasArg(OPT_thinlto_index_only) || + ctx.arg.thinLTOIndexOnly = ctx.arg.thinLTOIndex.size() || + args.hasArg(OPT_thinlto_index_only) || args.hasArg(OPT_thinlto_index_only_eq); ctx.arg.thinLTOIndexOnlyArg = args.getLastArgValue(OPT_thinlto_index_only_eq); ctx.arg.thinLTOObjectSuffixReplace = @@ -1469,7 +1472,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) { "--thinlto-emit-index-files"); } if (!ctx.arg.thinLTOPrefixReplaceNativeObject.empty() && - ctx.arg.thinLTOIndexOnlyArg.empty()) { + ctx.arg.thinLTOIndex.empty() && ctx.arg.thinLTOIndexOnlyArg.empty()) { error("--thinlto-prefix-replace=old_dir;new_dir;obj_dir must be used with " "--thinlto-index-only="); } @@ -2983,7 +2986,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) { // Skip the normal linked output if some LTO options are specified. // - // For --thinlto-index-only, index file creation is performed in + // For --thinlto-index{,-only}, index file creation is performed in // compileBitcodeFiles, so we are done afterwards. --plugin-opt=emit-llvm and // --plugin-opt=emit-asm create output files in bitcode or assembly code, // respectively. When only certain thinLTO modules are specified for |
