 
 import SwiftShims
 
-@_frozen // FIXME(sil-serialize-all)
+@_frozen // namespace
 public enum _DebuggerSupport {
-  @_frozen // FIXME(sil-serialize-all)
-  @usableFromInline // FIXME(sil-serialize-all)
-  internal enum CollectionStatus {
-    case NotACollection
-    case CollectionOfElements
-    case CollectionOfPairs
-    case Element
-    case Pair
-    case ElementOfPair
-  
-    @inlinable // FIXME(sil-serialize-all)
+  private enum CollectionStatus {
+    case notACollection
+    case collectionOfElements
+    case collectionOfPairs
+    case element
+    case pair
+    case elementOfPair
+  
     internal var isCollection: Bool {
-      return self != .NotACollection
-    }
-  
-    @inlinable // FIXME(sil-serialize-all)
+      return self != .notACollection
+    }
+  
     internal func getChildStatus(child: Mirror) -> CollectionStatus {
-      let disposition = child.displayStyle ?? .struct
-    
-      if disposition == .collection { return .CollectionOfElements }
-      if disposition == .dictionary { return .CollectionOfPairs }
-      if disposition == .set { return .CollectionOfElements }
-    
-      if self == .CollectionOfElements { return .Element }
-      if self == .CollectionOfPairs { return .Pair }
-      if self == .Pair { return .ElementOfPair }
-    
-      return .NotACollection
-    }
-  }
-
-  @inlinable // FIXME(sil-serialize-all)
-  internal static func isClass(_ value: Any) -> Bool {
-    if let _ = type(of: value) as? AnyClass {
-      return true
-    }
-    return false
-  }
-  
-  @inlinable // FIXME(sil-serialize-all)
-  internal static func checkValue<T>(
+      let disposition = child.displayStyle
+    
+      if disposition == .collection { return .collectionOfElements }
+      if disposition == .dictionary { return .collectionOfPairs }
+      if disposition == .set { return .collectionOfElements }
+    
+      if self == .collectionOfElements { return .element }
+      if self == .collectionOfPairs { return .pair }
+      if self == .pair { return .elementOfPair }
+    
+      return .notACollection
+    }
+  }
+
+  private static func isClass(_ value: Any) -> Bool {
+    return type(of: value) is AnyClass
+  }
+  
+  private static func checkValue<T>(
     _ value: Any,
     ifClass: (AnyObject) -> T,
     otherwise: () -> T

    parentCollectionStatus: CollectionStatus,
    refsAlreadySeen: inout Set<ObjectIdentifier>,
    maxItemCounter: inout Int,
    targetStream: inout StreamType
  ) {
    if maxItemCounter <= 0 {
      return
    }

    if !shouldExpand(mirror: mirror,
                     collectionStatus: parentCollectionStatus,
                     isRoot: isRoot) {
      return
    }

    maxItemCounter -= 1
  
    for _ in 0..<indent {
      print(" ", terminator: "", to: &targetStream)
    }

    // do not expand classes with no custom Mirror
    // yes, a type can lie and say it's a class when it's not since we only
    // check the displayStyle - but then the type would have a custom Mirror
    // anyway, so there's that...
    var willExpand = true
    if let ds = mirror.displayStyle {
      if ds == .`class` {
        if let x = value {
          if !(x is CustomReflectable) {
            willExpand = false
          }
        }
      }
    }

    let count = Int(mirror.children.count)
    let bullet = isRoot && (count == 0 || !willExpand) ? ""
      : count == 0    ? "- "
      : maxDepth <= 0 ? "▹ " : "▿ "
    print("\(bullet)", terminator: "", to: &targetStream)
  
    let collectionStatus = parentCollectionStatus.getChildStatus(child: mirror)
  
    if let nam = name {
      print("\(nam) : ", terminator: "", to: &targetStream)
    }

    if let str = asStringRepresentation(value: value, mirror: mirror, count: count) {
      print("\(str)", terminator: "", to: &targetStream)
    }
  
    if (maxDepth <= 0) || !willExpand {
      print("", to: &targetStream)
      return
    }

    if let x = value {
      if let valueIdentifier = asObjectIdentifier(x) {
        if refsAlreadySeen.contains(valueIdentifier) {
          print(" { ... }", to: &targetStream)
          return
        } else {
          refsAlreadySeen.insert(valueIdentifier)
        }
      }
    }

    print("", to: &targetStream)
  
    var printedElements = 0
  

        parentCollectionStatus: collectionStatus,
        refsAlreadySeen: &refsAlreadySeen,
        maxItemCounter: &maxItemCounter,
        target: &target)
      printedElements += 1
    }
  }

  public static func stringForPrintObject(_ value: Any) -> String {
    var maxItemCounter = Int.max
    var refs = Set<ObjectIdentifier>()
    var target = ""

    printForDebuggerImpl(
      value: value,
