[PATCH] D127778: [LTO][ELF] Add selective --save-temps= option

Jin Xin Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 18:15:42 PDT 2022


Northbadge added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1164
+  // --save-temps takes precedence over --save-temps=
+  if (!config->saveTemps) {
+    // parse --save-temps=
----------------
MaskRay wrote:
> Since there are only very few allowed values, SmallVector<StringRef, 0> may work better.
> You may deduplicate the values in lld/ELF/Driver.cpp
> 
> How about this: remove `bool config->saveTemps`. If `--save-temps` is specified, populate the array with all allowed values.
Wouldn't deduplicating the vector necessitate using a set (or sorting)? Also, if it were switched to being a vector there'd need to be a loop to check whether to save temps at a given stage, specifically at "prelink" (I placed a self-executing lambda there earlier on, it's not great for readability)

I agree with removing the bool though


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127778/new/

https://reviews.llvm.org/D127778



More information about the llvm-commits mailing list