https://github.com/sharadhr updated https://github.com/llvm/llvm-project/pull/121046
>From a9f921227abccda6c82137bed0b95041f584a147 Mon Sep 17 00:00:00 2001 From: Sharadh Rajaraman <r.shar...@outlook.sg> Date: Tue, 24 Dec 2024 09:32:21 +0000 Subject: [PATCH 1/2] Accept /Fo and -Fo in `-fmodule-output` when running under CL mode --- clang/lib/Driver/Driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index bc5ce9f14ab698..268d836841a107 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -5978,7 +5978,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); } >From bc9b68d11d8f4a2fe76b26b13d805126c40beafd Mon Sep 17 00:00:00 2001 From: Sharadh Rajaraman <r.shar...@outlook.sg> Date: Sun, 5 Jan 2025 14:09:24 +0000 Subject: [PATCH 2/2] Use `IsCLMode` to guard cl-style output argument presence --- clang/lib/Driver/Driver.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 268d836841a107..9ea9ea390216f3 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -5978,8 +5978,15 @@ 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, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON)) + Arg *FinalOutput = + IsCLMode() + ? C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo, + options::OPT__SLASH_Fo_COLON) + : C.getArgs().getLastArg(options::OPT_o); + + if (FinalOutput != nullptr) { return C.addResultFile(FinalOutput->getValue(), &JA); + } } // For /P, preprocess to file named after BaseInput. _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits