/*
   * When unit result is about to be accepted, removed back pointers
   * to compiler structures.
   */
  public void cleanUp() {
    if (this.compilationUnitBinding != null) this.compilationUnitBinding.cleanup();

    if (this.types != null) {
      for (int i = 0, max = this.types.length; i < max; i++) {
        cleanUp(this.types[i]);
      }
      for (int i = 0, max = this.localTypeCount; i < max; i++) {
        LocalTypeBinding localType = localTypes[i];
        // null out the type's scope backpointers
        localType.scope = null; // local members are already in the list
        localType.enclosingCase = null;
      }
    }

    for (int i = 0; i < this.numberInferredTypes; i++) {
      SourceTypeBinding binding = this.inferredTypes[i].binding;
      if (binding != null) binding.cleanup();
    }
    compilationResult.recoveryScannerData = null; // recovery is already done
  }
  /* Inner emulation consists in either recording a dependency
   * link only, or performing one level of propagation.
   *
   * Dependency mechanism is used whenever dealing with source target
   * types, since by the time we reach them, we might not yet know their
   * exact need.
   */
  public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
    if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0) return;
    ReferenceBinding allocatedTypeErasure = binding.declaringClass;

    // perform some emulation work in case there is some and we are inside a local type only
    if (allocatedTypeErasure.isNestedType() && currentScope.enclosingSourceType().isLocalType()) {

      if (allocatedTypeErasure.isLocalType()) {
        ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
        // request cascade of accesses
      }
    }
  }