anchor.diff:          dumpInfoTask.inlineCount.containsKey(entity);
     }
   
  -  LibraryInfo visitLibrary(LibraryEntity lib) {
  -    String libname = environment.getLibraryName(lib);
  -    if (libname.isEmpty) {
  +  LibraryInfo visitLibrary(ir.Library lib) {
  +    final libEntity = environment.lookupLibrary(lib.importUri);
  +    if (libEntity == null) return null;
  +
  +    String libname = lib.name;
  +    if (libname == null || libname.isEmpty) {
         libname = '<unnamed>';
       }
  -    int size = dumpInfoTask.sizeOf(lib);
  -    LibraryInfo info = LibraryInfo(libname, lib.canonicalUri, null, size);
  -    _entityToInfo[lib] = info;
  -
  -    environment.forEachLibraryMember(lib, (MemberEntity member) {
  -      if (member.isFunction || member.isGetter || member.isSetter) {
  -        FunctionInfo functionInfo = visitFunction(member);
  +
  +    int size = dumpInfoTask.sizeOf(libEntity);
  +    LibraryInfo info = LibraryInfo(libname, lib.importUri, null, size);
  +    _entityToInfo[libEntity] = info;
  +
  +    lib.members.forEach((ir.Member member) {
  +      final memberEntity =
  +          environment.lookupLibraryMember(libEntity, member.name.text);
  +      if (memberEntity == null) return;
  +
  +      if (member.function != null) {
  +        FunctionInfo functionInfo = visitFunction(memberEntity);
           if (functionInfo != null) {
             info.topLevelFunctions.add(functionInfo);
             functionInfo.parent = info;
           }
  -      } else if (member.isField) {
  -        FieldInfo fieldInfo = visitField(member);
  +      } else {
  +        FieldInfo fieldInfo = visitField(member, fieldEntity: memberEntity);
           if (fieldInfo != null) {
             info.topLevelVariables.add(fieldInfo);
             fieldInfo.parent = info;
  
positive.code:       }
      });
  
      environment.forEachClass(lib, (ClassEntity clazz) {
        ClassTypeInfo classTypeInfo = visitClassType(clazz);
        if (classTypeInfo != null) {
          info.classTypes.add(classTypeInfo);
          classTypeInfo.parent = info;
        }
  
        ClassInfo classInfo = visitClass(clazz);
        if (classInfo != null) {
          info.classes.add(classInfo);
          classInfo.parent = info;
        }
      });
  
      if (info.isEmpty && !shouldKeep(lib)) return null;
      result.libraries.add(info);
      return info;
    }
  
negative.code:           }
          }
        } else if (member.isField) {
          FieldInfo fieldInfo = visitField(member);
          if (fieldInfo != null) {
            classInfo.fields.add(fieldInfo);
            fieldInfo.parent = classInfo;
  