[Driver][Frontend] Add a -nostdlibimport argument

Add a -nostdlibimport (analagous to clang's -nostdlibinc) to remove the SDK paths from the import search paths, but leave the toolchain paths.

rdar://139322299
This commit is contained in:
Ian Anderson
2024-12-28 21:59:29 -05:00
parent 55189bae8e
commit ae753e61a1
4 changed files with 8 additions and 1 deletions

View File

@@ -507,6 +507,9 @@ public:
/// Don't look in for compiler-provided modules.
bool SkipRuntimeLibraryImportPaths = false;
/// Don't include SDK paths in the RuntimeLibraryImportPaths
bool ExcludeSDKPathsFromRuntimeLibraryImportPaths = false;
/// Scanner Prefix Mapper.
std::vector<std::string> ScannerPrefixMapper;

View File

@@ -359,6 +359,8 @@ def incremental : Flag<["-"], "incremental">,
HelpText<"Perform an incremental build if possible">;
def nostdimport : Flag<["-"], "nostdimport">, Flags<[FrontendOption]>,
HelpText<"Don't search the standard library or toolchain import paths for modules">;
def nostdlibimport : Flag<["-"], "nostdlibimport">, Flags<[FrontendOption]>,
HelpText<"Don't search the standard library import path for modules">;
def output_file_map : Separate<["-"], "output-file-map">,