[Lldb-commits] [lldb] r332163 - [LanguageRuntime/ObjC] Turn off ISA logging once and for all.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Fri May 11 17:33:13 PDT 2018


Author: davide
Date: Fri May 11 17:33:12 2018
New Revision: 332163

URL: http://llvm.org/viewvc/llvm-project?rev=332163&view=rev
Log:
[LanguageRuntime/ObjC] Turn off ISA logging once and for all.

On behalf of Jim, who's out today.

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

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=332163&r1=332162&r2=332163&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri May 11 17:33:12 2018
@@ -1437,6 +1437,8 @@ uint32_t AppleObjCRuntimeV2::ParseClassI
   //    } __attribute__((__packed__));
 
   Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
+  bool should_log = log && log->GetVerbose();
+
   uint32_t num_parsed = 0;
 
   // Iterate through all ClassInfo structures
@@ -1445,7 +1447,7 @@ uint32_t AppleObjCRuntimeV2::ParseClassI
     ObjCISA isa = data.GetPointer(&offset);
 
     if (isa == 0) {
-      if (log && log->GetVerbose())
+      if (should_log)
         log->Printf(
             "AppleObjCRuntimeV2 found NULL isa, ignoring this class info");
       continue;
@@ -1453,7 +1455,7 @@ uint32_t AppleObjCRuntimeV2::ParseClassI
     // Check if we already know about this ISA, if we do, the info will never
     // change, so we can just skip it.
     if (ISAIsCached(isa)) {
-      if (log)
+      if (should_log)
         log->Printf("AppleObjCRuntimeV2 found cached isa=0x%" PRIx64
                     ", ignoring this class info",
                     isa);
@@ -1464,14 +1466,14 @@ uint32_t AppleObjCRuntimeV2::ParseClassI
       ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
       AddClass(isa, descriptor_sp, name_hash);
       num_parsed++;
-      if (log)
+      if (should_log)
         log->Printf("AppleObjCRuntimeV2 added isa=0x%" PRIx64
                     ", hash=0x%8.8x, name=%s",
                     isa, name_hash,
                     descriptor_sp->GetClassName().AsCString("<unknown>"));
     }
   }
-  if (log)
+  if (should_log)
     log->Printf("AppleObjCRuntimeV2 parsed %" PRIu32 " class infos",
                 num_parsed);
   return num_parsed;




More information about the lldb-commits mailing list