Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-cl] Accept cl-style output arguments (/Fo, -Fo) for --fmodule-output #121046

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sharadhr
Copy link
Contributor

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Dec 24, 2024
@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from d8108f0 to 350a517 Compare December 24, 2024 09:31
@llvmbot
Copy link
Member

llvmbot commented Dec 24, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Sharadh Rajaraman (sharadhr)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/121046.diff

1 Files Affected:

  • (modified) clang/lib/Driver/Driver.cpp (+2-2)
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);
   }
 

@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from 350a517 to e1708db Compare December 24, 2024 09:32
@ChuanqiXu9
Copy link
Member

The tests are failing and it looks relevent.

@ChuanqiXu9 ChuanqiXu9 self-requested a review December 25, 2024 01:36
@nikic
Copy link
Contributor

nikic commented Jan 3, 2025

Why is this submitted against the release/19.x branch? Is this a backport? If so, please indicate which commit it backports.

@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from e1708db to bc9b68d Compare January 5, 2025 14:51
@sharadhr sharadhr changed the base branch from release/19.x to main January 5, 2025 14:52
@sharadhr
Copy link
Contributor Author

sharadhr commented Jan 5, 2025

Why is this submitted against the release/19.x branch? Is this a backport? If so, please indicate which commit it backports.

Not a backport but a new commit. I have now re-submitted it against main, but I'd like it back-ported to 19.x if possible.

@ChuanqiXu9
Copy link
Member

Why is this submitted against the release/19.x branch? Is this a backport? If so, please indicate which commit it backports.

Not a backport but a new commit. I have now re-submitted it against main, but I'd like it back-ported to 19.x if possible.

It is better to fix the test failures (or announce they are not relevant with your pr)

@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from 7487d82 to ff22639 Compare January 12, 2025 21:44
Copy link

github-actions bot commented Jan 12, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from ff22639 to d7a2799 Compare January 12, 2025 21:56
@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from d7a2799 to d7b7e93 Compare January 12, 2025 22:07
@sharadhr sharadhr force-pushed the clang-cl-accept-Fo-fmodule-output branch from a839072 to 1f40c12 Compare January 12, 2025 23:56
@sharadhr
Copy link
Contributor Author

I'm not sure how to fix the Driver/at_file.c and ClangScanDeps/target-filename.cpp tests. I'd love some help with these.

@sharadhr sharadhr changed the title Accept cl-style output arguments (/Fo, -Fo) for --fmodule-output [clang-cl] Accept cl-style output arguments (/Fo, -Fo) for --fmodule-output Jan 14, 2025
@Endilll Endilll removed their request for review January 15, 2025 18:39
@sharadhr
Copy link
Contributor Author

@ChuanqiXu9 are you able to have a look?

@ChuanqiXu9
Copy link
Member

@ChuanqiXu9 are you able to have a look?

Sorry, I can't test and take a deeper look on windows. From https://discourse.llvm.org/t/driver-volunteer-wanted-for-modules-support-in-driver-for-mac-ubuntu-and-windows/83768/13, I think you can CC people there or calling again there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants