[Lldb-commits] [PATCH] D13948: [AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 21 08:53:09 PDT 2015


labath created this revision.
labath added reviewers: clayborg, jingham.
labath added a subscriber: lldb-commits.

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.

http://reviews.llvm.org/D13948

Files:
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
===================================================================
--- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -382,8 +382,11 @@
 {
     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());
     


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13948.38020.patch
Type: text/x-patch
Size: 746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151021/7bf428f9/attachment.bin>


More information about the lldb-commits mailing list