Skip to content

Commit c42b640

Browse files
Fix the DEVELOPER_DIR computation (llvm#70528)
The code was incorrectly going into the wrong direction by removing one component instead of appendeing /Developer to it. Due to fallback mechanisms in xcrun this never seemed to have caused any issues.
1 parent 284d136 commit c42b640

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,11 @@ static void ParseOSVersion(llvm::VersionTuple &version, NSString *Key) {
461461
// Invoke xcrun with the shlib dir.
462462
if (FileSpec fspec = HostInfo::GetShlibDir()) {
463463
if (FileSystem::Instance().Exists(fspec)) {
464-
std::string contents_dir =
465-
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath());
466-
llvm::StringRef shlib_developer_dir =
467-
llvm::sys::path::parent_path(contents_dir);
468-
if (!shlib_developer_dir.empty()) {
469-
auto sdk =
470-
xcrun(sdk_name, show_sdk_path, std::move(shlib_developer_dir));
464+
llvm::SmallString<0> shlib_developer_dir(
465+
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath()));
466+
llvm::sys::path::append(shlib_developer_dir, "Developer");
467+
if (FileSystem::Instance().Exists(shlib_developer_dir)) {
468+
auto sdk = xcrun(sdk_name, show_sdk_path, shlib_developer_dir);
471469
if (!sdk)
472470
return sdk.takeError();
473471
if (!sdk->empty())

0 commit comments

Comments
 (0)