[llvm-branch-commits] [clang] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--fmodule-output` (PR #121046)

Sharadh Rajaraman via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 24 01:30:55 PST 2024


https://github.com/sharadhr created https://github.com/llvm/llvm-project/pull/121046

None

>From d8108f0aa7351d4ba8766e8f225ef6c117dc2f0c Mon Sep 17 00:00:00 2001
From: Sharadh Rajaraman <r.sharadh at outlook.sg>
Date: Tue, 24 Dec 2024 09:26:42 +0000
Subject: [PATCH] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for
 `--fmodule-output`

- Edited condition to also accept `OPT__SLASH_Fo`, and `OPT__SLASH_Fo_COLON`
---
 clang/lib/Driver/Driver.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index ecae475f75da00..b47e0443d6e9db 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -5442,7 +5442,7 @@ InputInfoList Driver::BuildJobsForAction(
   InputInfoList Result = BuildJobsForActionNoCache(
       C, A, TC, BoundArch, AtTopLevel, MultipleArchs, LinkingOutput,
       CachedResults, TargetDeviceOffloadKind);
-  CachedResults[ActionTC] = Result;
+   CachedResults[ActionTC] = Result;
   return Result;
 }
 
@@ -5890,7 +5890,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
   llvm::PrettyStackTraceString CrashInfo("Computing output path");
   // Output to a user requested destination?
   if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) {
-    if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
+    if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON))
       return C.addResultFile(FinalOutput->getValue(), &JA);
   }
 



More information about the llvm-branch-commits mailing list