[Lldb-commits] [lldb] db8b159 - [lldb] Inline objc_opt->version >= 14 to avoid dealing with bool type

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 2 16:42:09 PST 2021


Author: Jonas Devlieghere
Date: 2021-03-02T16:41:44-08:00
New Revision: db8b1598b7187ff378b7b82c266d1993b0a39191

URL: https://github.com/llvm/llvm-project/commit/db8b1598b7187ff378b7b82c266d1993b0a39191
DIFF: https://github.com/llvm/llvm-project/commit/db8b1598b7187ff378b7b82c266d1993b0a39191.diff

LOG: [lldb] Inline objc_opt->version >= 14 to avoid dealing with bool type

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 90ef5e1c7403..30ee257f2b29 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -247,8 +247,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
     {
         const objc_opt_t *objc_opt = (objc_opt_t *)objc_opt_ro_ptr;
         const objc_opt_v14_t* objc_opt_v14 = (objc_opt_v14_t*)objc_opt_ro_ptr;
-        const bool is_v14_format = objc_opt->version >= 14;
-        if (is_v14_format)
+        if (objc_opt->version >= 14)
         {
             DEBUG_PRINTF ("objc_opt->version = %u\n", objc_opt_v14->version);
             DEBUG_PRINTF ("objc_opt->flags = %u\n", objc_opt_v14->flags);
@@ -266,7 +265,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
         if (objc_opt->version == 12 || objc_opt->version == 13 || objc_opt->version == 14 || objc_opt->version == 15)
         {
             const objc_clsopt_t* clsopt = NULL;
-            if (is_v14_format)
+            if (objc_opt->version >= 14)
                 clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt_v14 + objc_opt_v14->clsopt_offset);
             else
                 clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt + objc_opt->clsopt_offset);


        


More information about the lldb-commits mailing list