Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static bool DefaultComputeClangResourceDirectory(FileSpec &lldb_shlib_spec, | ||||
FileSpec &file_spec, | FileSpec &file_spec, | ||||
bool verify) { | bool verify) { | ||||
Log *log = GetLog(LLDBLog::Host); | Log *log = GetLog(LLDBLog::Host); | ||||
std::string raw_path = lldb_shlib_spec.GetPath(); | std::string raw_path = lldb_shlib_spec.GetPath(); | ||||
llvm::StringRef parent_dir = llvm::sys::path::parent_path(raw_path); | llvm::StringRef parent_dir = llvm::sys::path::parent_path(raw_path); | ||||
static const llvm::StringRef kResourceDirSuffixes[] = { | static const llvm::StringRef kResourceDirSuffixes[] = { | ||||
// LLVM.org's build of LLDB uses the clang resource directory placed | // LLVM.org's build of LLDB uses the clang resource directory placed | ||||
// in $install_dir/lib{,64}/clang/$clang_version. | // in $install_dir/lib{,64}/clang/$clang_version or | ||||
CLANG_INSTALL_LIBDIR_BASENAME "/clang/" CLANG_VERSION_MAJOR_STRING, | // $install_dir/bin/$CLANG_RESOURCE_DIR | ||||
CLANG_RESOURCE_DIR[0] ? "bin/" CLANG_RESOURCE_DIR | |||||
: CLANG_INSTALL_LIBDIR_BASENAME | |||||
"/clang/" CLANG_VERSION_MAJOR_STRING, | |||||
// swift-lldb uses the clang resource directory copied from swift, which | // swift-lldb uses the clang resource directory copied from swift, which | ||||
// by default is placed in $install_dir/lib{,64}/lldb/clang. LLDB places | // by default is placed in $install_dir/lib{,64}/lldb/clang. LLDB places | ||||
// it there, so we use LLDB_INSTALL_LIBDIR_BASENAME. | // it there, so we use LLDB_INSTALL_LIBDIR_BASENAME. | ||||
LLDB_INSTALL_LIBDIR_BASENAME "/lldb/clang", | LLDB_INSTALL_LIBDIR_BASENAME "/lldb/clang", | ||||
}; | }; | ||||
for (const auto &Suffix : kResourceDirSuffixes) { | for (const auto &Suffix : kResourceDirSuffixes) { | ||||
llvm::SmallString<256> clang_dir(parent_dir); | llvm::SmallString<256> clang_dir(parent_dir); | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |