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());
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());
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits