[AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets

Summary:
This short-circuits the GetObjCVersion function to avoid iterating through target modules on
non-apple targets. This function is called on every Process::IsDynamicValue call, so this
overhead is not negligible.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13948

llvm-svn: 251004
This commit is contained in:
Pavel Labath 2015-10-22 09:34:40 +00:00
parent 02f1c5d132
commit 31bcd2bddd
1 changed files with 4 additions and 1 deletions

View File

@ -382,8 +382,11 @@ AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
{
if (!process)
return ObjCRuntimeVersions::eObjC_VersionUnknown;
Target &target = process->GetTarget();
if (target.GetArchitecture().GetTriple().getVendor() != llvm::Triple::VendorType::Apple)
return ObjCRuntimeVersions::eObjC_VersionUnknown;
const ModuleList &target_modules = target.GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());