Skip to content

[embedded] Detect WMO via .hasPrimaryInputs() instead of -wmo flag presence #68568

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

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

kubamracek
Copy link
Contributor

No description provided.

@kubamracek kubamracek added the embedded Embedded Swift label Sep 16, 2023
@kubamracek
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@@ -1323,6 +1323,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Diags.diagnose(SourceLoc(), diag::evolution_with_embedded);
HadError = true;
}

if (FrontendOpts.InputsAndOutputs.hasPrimaryInputs()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t really understand this. Primaries and WMO don’t really mix. Are you trying to detect the optimization mode, or the compilation mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for chiming in here, I could use some help with this :)

What I’m trying to do is to require WMO, the compilation mode. I thought that the presense of a primary file is a clear sign that we’re not doing WMO (and vice versa). Is that not true?

@kubamracek kubamracek requested a review from CodaFi September 17, 2023 18:06
@eeckstein
Copy link
Contributor

WMO checking is already done by #68358, right?

@kubamracek
Copy link
Contributor Author

kubamracek commented Sep 18, 2023

Yes, but I realized that the -wmo flag is a flag for the driver, and not for the frontend. So #68358 isn't going to work if we actually compile with the driver (the driver doesn't pass it down to the frontend). This is the whole point of this PR, I should have started with stating that, sorry! :)

@kubamracek kubamracek force-pushed the embedded-wmo-via-primaryfiles branch from 073930b to d2f8530 Compare September 26, 2023 00:24
@kubamracek
Copy link
Contributor Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit f14b426 into main Sep 26, 2023
@swift-ci swift-ci deleted the embedded-wmo-via-primaryfiles branch September 26, 2023 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Embedded Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants