Author: labath
Date: Thu Oct 22 04:34:40 2015
New Revision: 251004

URL: http://llvm.org/viewvc/llvm-project?rev=251004&view=rev
Log:
[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

Modified:
    
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=251004&r1=251003&r2=251004&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
 Thu Oct 22 04:34:40 2015
@@ -382,8 +382,11 @@ AppleObjCRuntime::GetObjCVersion (Proces
 {
     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());
     


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to