mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Caching][Macro] Make macro plugin options cacheable
Currently, the macro plugin options are included as cache key and the absolute path of the plugin executable and library will affect cache hit, even the plugin itself is identical. Using the new option `-resolved-plugin-validation` flag, the macro plugin paths are remapped just like the other paths during dependency scanning. `swift-frontend` will unmap to its original path during the compilation, make sure the content hasn't changed, and load the plugin. It also hands few other corner cases for macro plugins: * Make sure the plugin options in the swift module is prefix mapped. * Make sure the remarks of the macro loading is not cached, as the mesasge includes the absolute path of the plugin, and is not cacheable. rdar://148465899
This commit is contained in:
@@ -2417,6 +2417,9 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
|
||||
Opts.ScannerPrefixMapper.push_back(Opt.str());
|
||||
}
|
||||
|
||||
Opts.ResolvedPluginVerification |=
|
||||
Args.hasArg(OPT_resolved_plugin_verification);
|
||||
|
||||
// rdar://132340493 disable scanner-side validation for non-caching builds
|
||||
Opts.ScannerModuleValidation |= Args.hasFlag(OPT_scanner_module_validation,
|
||||
OPT_no_scanner_module_validation,
|
||||
|
||||
Reference in New Issue
Block a user