[Frontend][test] Minor changes from "-nostdimport and -nostdlibimport should remove the default framework search paths"

Put the SDK path in a SmallString instead of a StringRef for ease of downstream merging.
Simplify the command lines for the search path test.
This commit is contained in:
Ian Anderson
2025-05-23 22:06:41 -07:00
parent a7a9b0a6b5
commit 1197e2ef2e
2 changed files with 9 additions and 7 deletions

View File

@@ -312,7 +312,8 @@ updateImplicitFrameworkSearchPaths(SearchPathOptions &SearchPathOpts,
if (LangOpts.Target.isOSDarwin()) {
if (!SearchPathOpts.SkipSDKImportPaths &&
!SearchPathOpts.getSDKPath().empty()) {
StringRef SDKPath = SearchPathOpts.getSDKPath();
SmallString<128> SDKPath(SearchPathOpts.getSDKPath());
SmallString<128> systemFrameworksScratch(SDKPath);
llvm::sys::path::append(systemFrameworksScratch, "System", "Library",
"Frameworks");
@@ -321,6 +322,7 @@ updateImplicitFrameworkSearchPaths(SearchPathOptions &SearchPathOpts,
"SubFrameworks");
SmallString<128> frameworksScratch(SDKPath);
llvm::sys::path::append(frameworksScratch, "Library", "Frameworks");
ImplicitFrameworkSearchPaths = {systemFrameworksScratch.str().str(),
systemSubFrameworksScratch.str().str(),
frameworksScratch.str().str()};