[lld] [LLD][COFF] allow saving intermediate files with /lldsavetemps (PR #115131)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 13:25:06 PST 2024


================
@@ -2012,8 +2016,18 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
   config->ltoDebugPassManager = ltoDebugPM;
 
   // Handle /lldsavetemps
-  if (args.hasArg(OPT_lldsavetemps))
-    config->saveTemps = true;
+  if (args.hasArg(OPT_lldsavetemps)) {
+    for (const char *s : lldsaveTempsValues)
----------------
mstorsjo wrote:

Yeah, as long as we already have a list of the allowed elements (in order to error out early if passing an unsupported option) we can probably just go with it. (I guess the other alternative is to not error out early if passing unsupported values.

I'm ok with keeping this as is, I just wanted to talk through the various tradeoffs involved :-)

Also, I see that we already have the exact same analogue in the ELF driver, so that's another reason to keep things similar.

https://github.com/llvm/llvm-project/pull/115131


More information about the llvm-commits mailing list