[Lldb-commits] [lldb] r285599 - Remove a couple of old TODOs and don't make a new ConstString each time; none of this is super-critical since it applies to older versions of macOS (or OSX, I guess?) but still..

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 31 10:12:16 PDT 2016


Author: enrico
Date: Mon Oct 31 12:12:16 2016
New Revision: 285599

URL: http://llvm.org/viewvc/llvm-project?rev=285599&view=rev
Log:
Remove a couple of old TODOs and don't make a new ConstString each time; none of this is super-critical since it applies to older versions of macOS (or OSX, I guess?) but still..


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=285599&r1=285598&r2=285599&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Mon Oct 31 12:12:16 2016
@@ -1911,8 +1911,6 @@ void AppleObjCRuntimeV2::WarnIfNoClasses
   }
 }
 
-// TODO: should we have a transparent_kvo parameter here to say if we
-// want to replace the KVO swizzled class with the actual user-level type?
 ConstString
 AppleObjCRuntimeV2::GetActualTypeName(ObjCLanguageRuntime::ObjCISA isa) {
   if (isa == g_objc_Tagged_ISA) {
@@ -2166,23 +2164,28 @@ AppleObjCRuntimeV2::TaggedPointerVendorL
   uint64_t class_bits = (ptr & 0xE) >> 1;
   ConstString name;
 
-  // TODO: make a table
+  static ConstString g_NSAtom("NSAtom");
+  static ConstString g_NSNumber("NSNumber");
+  static ConstString g_NSDateTS("NSDateTS");
+  static ConstString g_NSManagedObject("NSManagedObject");
+  static ConstString g_NSDate("NSDate");
+
   if (foundation_version >= 900) {
     switch (class_bits) {
     case 0:
-      name = ConstString("NSAtom");
+      name = g_NSAtom;
       break;
     case 3:
-      name = ConstString("NSNumber");
+      name = g_NSNumber;
       break;
     case 4:
-      name = ConstString("NSDateTS");
+      name = g_NSDateTS;
       break;
     case 5:
-      name = ConstString("NSManagedObject");
+      name = g_NSManagedObject;
       break;
     case 6:
-      name = ConstString("NSDate");
+      name = g_NSDate;
       break;
     default:
       return ObjCLanguageRuntime::ClassDescriptorSP();
@@ -2190,16 +2193,16 @@ AppleObjCRuntimeV2::TaggedPointerVendorL
   } else {
     switch (class_bits) {
     case 1:
-      name = ConstString("NSNumber");
+      name = g_NSNumber;
       break;
     case 5:
-      name = ConstString("NSManagedObject");
+      name = g_NSManagedObject;
       break;
     case 6:
-      name = ConstString("NSDate");
+      name = g_NSDate;
       break;
     case 7:
-      name = ConstString("NSDateTS");
+      name = g_NSDateTS;
       break;
     default:
       return ObjCLanguageRuntime::ClassDescriptorSP();




More information about the lldb-commits mailing list