code: private static void moveMarkedWeakSources(JSModule weakModule, Iterable<CompilerInput> inputs) {
      checkNotNull(weakModule);
      ImmutableList<CompilerInput> allInputs = ImmutableList.copyOf(inputs);
      for (CompilerInput i : allInputs) {
        if (i.getSourceFile().isWeak()) {
          JSModule existingModule = i.getModule();
          if (existingModule == weakModule) {
            continue;
          }
          if (existingModule != null) {
            existingModule.remove(i);
          }
          weakModule.add(i);
        }
      }
    }
docs: Moves all sources that have {@link SourceKind#WEAK} into the weak module so that they may be
  pruned later.