forked from OSchip/llvm-project
Fix a regression in r332111. The LLDB.framework path component is not
usually the last component. llvm-svn: 332120
This commit is contained in:
parent
99d5c072f0
commit
5103e48bad
|
@ -253,7 +253,13 @@ bool HostInfoMacOSX::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
|
|||
auto r_end = llvm::sys::path::rend(raw_path);
|
||||
|
||||
// Check for a Posix-style build of LLDB.
|
||||
if (rev_it == r_end || *rev_it != "LLDB.framework")
|
||||
while (rev_it != r_end) {
|
||||
if (*rev_it == "LLDB.framework")
|
||||
break;
|
||||
++rev_it;
|
||||
}
|
||||
|
||||
if (rev_it == r_end)
|
||||
return HostInfoPosix::ComputeClangDirectory(file_spec);
|
||||
|
||||
// Inside Xcode and in Xcode toolchains LLDB is always in lockstep
|
||||
|
|
|
@ -63,8 +63,14 @@ TEST_F(HostInfoTest, MacOSX) {
|
|||
std::string posix = "/usr/lib/liblldb.dylib";
|
||||
EXPECT_FALSE(HostInfoMacOSXTest::ComputeClangDir(posix).empty());
|
||||
|
||||
std::string framework =
|
||||
"/SharedFrameworks/LLDB.framework";
|
||||
std::string framework_clang =
|
||||
"/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang";
|
||||
EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(framework), framework_clang);
|
||||
|
||||
std::string xcode =
|
||||
"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework";
|
||||
"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A";
|
||||
std::string xcode_clang =
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/"
|
||||
"XcodeDefault.xctoolchain/usr/lib/swift/clang";
|
||||
|
|
Loading…
Reference in New Issue