-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Added new frontend flag to accelerate clang importer #5316
Conversation
@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"); | |||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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">; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok yeah. Good idea.
Seems fine to me. Ben? |
I agree the help message should be tweaked. Otherwise LGTM. |
…rom clang importer flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
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.