Skip to content

Added new frontend flag to accelerate clang importer #5316

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 2 commits into from
Dec 19, 2016
Merged

Added new frontend flag to accelerate clang importer #5316

merged 2 commits into from
Dec 19, 2016

Conversation

mxswd
Copy link
Contributor

@mxswd mxswd commented Oct 16, 2016

This patch adds a new frontend flag -disable-modules-validate-system-headers that stops the clang importer from passing -fmodules-validate-system-headers. See clang for why you would want to pass this flag.

@mxswd
Copy link
Contributor Author

mxswd commented Oct 16, 2016

@jrose-apple @benlangmuir thoughts?

@@ -345,6 +344,10 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
SHIMS_INCLUDE_FLAG, searchPathOpts.RuntimeResourcePath,
});

if (!importerOpts.DisableModulesValidateSystemHeaders) {
invocationArgStrs.push_back("-fmodules-validate-system-headers");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Can you move this down to the end of the function where the other importerOpts options are checked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You sure? I thought up here next to all the module stuff.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's supposed to be "universal arguments that don't change", "platform-based arguments that don't change", and then "conditional arguments and arguments with values". I guess that's not so clear from what's there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok makes sense. I will update that.

@@ -224,6 +224,9 @@ def disable_sil_linking : Flag<["-"], "disable-sil-linking">,
def dump_clang_diagnostics : Flag<["-"], "dump-clang-diagnostics">,
HelpText<"Dump Clang diagnostics to stderr">;

def disable_modules_validate_system_headers : Flag<["-"], "disable-modules-validate-system-headers">,
HelpText<"Disable modules validate system headers in the clang importer">;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: This text could use a bit of cleanup, even if it's not really going to be seen by anyone. "Disable validating system headers in the Clang importer", perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok yeah. Good idea.

@jrose-apple
Copy link
Contributor

Seems fine to me. Ben?

@benlangmuir
Copy link
Contributor

I agree the help message should be tweaked. Otherwise LGTM.

Copy link
Contributor Author

@mxswd mxswd left a comment

Choose a reason for hiding this comment

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

Fixed!

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

1 similar comment
@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit e3809e0 into swiftlang:master Dec 19, 2016
@mxswd mxswd deleted the disable-modules-validate-system-headers branch December 19, 2016 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants