Michael137 created this revision. Michael137 added a reviewer: aprantl. Herald added a subscriber: kadircet. Herald added a project: All. Michael137 requested review of this revision. Herald added subscribers: lldb-commits, ilya-biryukov. Herald added a project: LLDB.
The call to `HostInfoMacOSX::GetSDKRoot` can noticeably slow down the first expression evaluation in an LLDB session. For C++ expressions we don't actually ever use the results of the `ClangDeclVendor`, so getting the flags right isn't necessary. Thus skip SDK parsing logic for C++ targets. An alternative would be to entirely omit the setup of the ClangDeclVendor (and other Objective-C machinery) for C++ targets. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D157512 Files: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -18,6 +18,7 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" +#include "lldb/Target/Language.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" @@ -1097,7 +1098,7 @@ FileSpec sysroot_spec; - if (target) { + if (target && Language::LanguageIsObjC(target->GetLanguage())) { if (ModuleSP exe_module_sp = target->GetExecutableModule()) { auto path_or_err = ResolveSDKPathFromDebugInfo(*exe_module_sp); if (path_or_err) {
Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -18,6 +18,7 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" +#include "lldb/Target/Language.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" @@ -1097,7 +1098,7 @@ FileSpec sysroot_spec; - if (target) { + if (target && Language::LanguageIsObjC(target->GetLanguage())) { if (ModuleSP exe_module_sp = target->GetExecutableModule()) { auto path_or_err = ResolveSDKPathFromDebugInfo(*exe_module_sp); if (path_or_err) {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits