diff options
author | Pavel Labath <labath@google.com> | 2015-10-22 09:34:40 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2015-10-22 09:34:40 +0000 |
commit | 31bcd2bddde3b39105da5e658d98cdb4b8c4ce16 (patch) | |
tree | ba6e73636c61d94ec56abd9a0f7d7f8e8f6ca431 | |
parent | 02f1c5d132c6a169dffe2a2b8cd8f937838e0b7a (diff) | |
download | bcm5719-llvm-31bcd2bddde3b39105da5e658d98cdb4b8c4ce16.tar.gz bcm5719-llvm-31bcd2bddde3b39105da5e658d98cdb4b8c4ce16.zip |
[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
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 96ef6cb0345..cdb95250b2f 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -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()); |