Revert recent performance-related  commits.

As requested, reverts recent performance related commits that
were submitted to the code base recently. Since none of them changed
GN's behavior, this should not introduce any regression.

  7c8e511229f0fc06f6250367d51156bb6f578258  "AlignedAlloc<>: Use posix_memalloc() on MacOS"
  1cdd270be9803dbfcdd0343f6104ad4dc30c38ce  "Add ResolvedTargetData class"
  9e3df46b88e7f832389abf47c18ba4f122e864c1  "Add TaggedPointer<T,N> template."
  e2345a893fbb902761a40e4ec4b30f26c84480ff  "Add ImmutableVector and ImmutableVectorView templates."
  a331a36c92c01ae459158660a4d1bf4c913f0335  "Add AlignedAlloc<N> template."

Bug: None
Change-Id: Id6191d6c9781b4808f7ff8a2655baa48a2bb6f74
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/13860
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Takuto Ikuta <tikuta@google.com>
diff --git a/build/gen.py b/build/gen.py
index ce600e7..c7a73a8 100755
--- a/build/gen.py
+++ b/build/gen.py
@@ -681,7 +681,6 @@
         'src/gn/pattern.cc',
         'src/gn/pool.cc',
         'src/gn/qt_creator_writer.cc',
-        'src/gn/resolved_target_data.cc',
         'src/gn/runtime_deps.cc',
         'src/gn/rust_substitution_type.cc',
         'src/gn/rust_tool.cc',
@@ -770,7 +769,6 @@
         'src/gn/functions_unittest.cc',
         'src/gn/hash_table_base_unittest.cc',
         'src/gn/header_checker_unittest.cc',
-        'src/gn/immutable_vector_unittest.cc',
         'src/gn/inherited_libraries_unittest.cc',
         'src/gn/input_conversion_unittest.cc',
         'src/gn/json_project_writer_unittest.cc',
@@ -801,8 +799,6 @@
         'src/gn/path_output_unittest.cc',
         'src/gn/pattern_unittest.cc',
         'src/gn/pointer_set_unittest.cc',
-        'src/gn/resolved_target_data_unittest.cc',
-        'src/gn/resolved_target_deps_unittest.cc',
         'src/gn/runtime_deps_unittest.cc',
         'src/gn/scope_per_file_provider_unittest.cc',
         'src/gn/scope_unittest.cc',
@@ -814,9 +810,7 @@
         'src/gn/string_utils_unittest.cc',
         'src/gn/substitution_pattern_unittest.cc',
         'src/gn/substitution_writer_unittest.cc',
-        'src/gn/tagged_pointer_unittest.cc',
         'src/gn/target_unittest.cc',
-        'src/gn/target_public_pair_unittest.cc',
         'src/gn/template_unittest.cc',
         'src/gn/test_with_scheduler.cc',
         'src/gn/test_with_scope.cc',
@@ -830,7 +824,6 @@
         'src/gn/visual_studio_writer_unittest.cc',
         'src/gn/xcode_object_unittest.cc',
         'src/gn/xml_element_writer_unittest.cc',
-        'src/util/aligned_alloc_unittest.cc',
         'src/util/test/gn_test.cc',
       ], 'libs': []},
   }
diff --git a/src/gn/immutable_vector.h b/src/gn/immutable_vector.h
deleted file mode 100644
index 0897bec..0000000
--- a/src/gn/immutable_vector.h
+++ /dev/null
@@ -1,244 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_GN_IMMUTABLE_VECTOR_H_
-#define TOOLS_GN_IMMUTABLE_VECTOR_H_
-
-#include <cstdlib>
-#include <type_traits>
-#include <utility>
-
-#include "util/aligned_alloc.h"
-
-// An ImmutableVector<T> represents a fixed-size vector of constant items of
-// type T. The in-memory representation is more efficient, only using one
-// pointer to a single heap-allocated memory block that also contains the size.
-//
-// An ImmutableVectorView<T> acts as a copyable and movable reference to another
-// ImmutableVector<T> instance. They both point to the same memory in the heap,
-// but the view is not owning and is invalidated when the instance it points to
-// is destroyed.
-//
-// Apart from that, they can be used with the same methods as a  const
-// std::vector<T>.
-//
-template <typename T>
-class ImmutableVector;
-
-template <typename T>
-class ImmutableVectorView {
- public:
-  // Default constructor
-  ImmutableVectorView() = default;
-
-  // Constructor from an ImmutableVector.
-  ImmutableVectorView(const ImmutableVector<T>& vector)
-      : header_(vector.header_) {}
-
-  // Usual methods to access items.
-  const T* data() const { return begin(); }
-  size_t size() const { return header_ ? header_->size : 0u; }
-  bool empty() const { return size() == 0; }
-  const T& operator[](size_t offset) const { return begin()[offset]; }
-
-  const T* begin() const { return header_ ? &header_->item0 : nullptr; }
-  const T* end() const {
-    return header_ ? &header_->item0 + header_->size : nullptr;
-  }
-
-  const T& front() const { return begin()[0]; }
-  const T& back() const { return end()[-1]; }
-
-  // For use with standard algorithms and templates.
-  using element_type = T;
-  using value_type = std::remove_cv_t<T>;
-  using size_type = std::size_t;
-  using difference_type = std::ptrdiff_t;
-  using pointer = T*;
-  using const_pointer = const T*;
-  using reference = T&;
-  using const_reference = const T&;
-  using iterator = const T*;
-  using const_iterator = const T*;
-
-  const_iterator find(const T& item) const {
-    auto it = begin();
-    auto it_end = end();
-    for (; it != it_end; ++it) {
-      if (*it == item)
-        break;
-    }
-    return it;
-  }
-
-  bool contains(const T& item) const {
-    for (const auto& cur_item : *this)
-      if (cur_item == item)
-        return true;
-
-    return false;
-  }
-
- protected:
-  struct Header {
-    size_t size;
-    T item0;
-  };
-
-  ImmutableVectorView(Header* header) : header_(header) {}
-
-  Header* header_ = nullptr;
-};
-
-template <typename T>
-class ImmutableVector : public ImmutableVectorView<T> {
- public:
-  // Default constructor.
-  ImmutableVector() = default;
-
-  // Range constructors.
-  ImmutableVector(const T* begin, size_t size)
-      : ImmutableVectorView<T>(AllocateAndCopyFrom(begin, size)) {}
-
-  ImmutableVector(const T* begin, const T* end)
-      : ImmutableVector(begin, end - begin) {}
-
-  // In-place constructor
-  // |producer| must be a callable that generates a T instance that will
-  // be used to construct items in place in the allocated vector.
-  template <typename P,
-            typename = std::void_t<
-                decltype(static_cast<const T&>(std::declval<P>()()))>>
-  ImmutableVector(P producer, size_t size) {
-    if (size) {
-      this->header_ = AllocateFor(size);
-      auto* dst = &(this->header_->item0);
-      auto* dst_limit = dst + size;
-      for (; dst != dst_limit; ++dst)
-        new (dst) T(producer());
-    }
-  }
-
-  // Container constructor
-  //
-  // This uses std::void_t<> to select container types whose values
-  // are convertible to |const T&|, and which have |begin()| and |size()|
-  // methods.
-  //
-  // This constructor copies items from the constructor into the
-  // ImmutableVector.
-  template <typename C,
-            typename = std::void_t<
-                decltype(static_cast<const T>(*std::declval<C>().begin())),
-                decltype(std::declval<C>().size())>>
-  ImmutableVector(const C& container) {
-    size_t size = container.size();
-    if (size) {
-      this->header_ = AllocateFor(size);
-      auto src = container.begin();
-      auto* dst = &(this->header_->item0);
-      auto* dst_limit = dst + size;
-      for (; dst != dst_limit; ++dst, ++src) {
-        new (dst) T(*src);
-      }
-    }
-  }
-
-  // Another container constructor where the items can be moved into
-  // the resulting ImmutableVector.
-  template <typename C,
-            typename = std::void_t<
-                decltype(static_cast<const T>(*std::declval<C>().begin())),
-                decltype(std::declval<C>().size())>>
-  ImmutableVector(C&& container) {
-    size_t size = container.size();
-    if (size) {
-      this->header_ = AllocateFor(size);
-      auto src = container.begin();
-      auto* dst = &(this->header_->item0);
-      auto* dst_limit = dst + size;
-      for (; dst != dst_limit; ++dst, ++src)
-        new (dst) T(std::move(*src));
-    }
-  }
-
-  // Initializer-list container.
-  ImmutableVector(std::initializer_list<T> list)
-      : ImmutableVector(list.begin(), list.size()) {}
-
-  // Copy operations
-  ImmutableVector(const ImmutableVector& other)
-      : ImmutableVectorView<T>(
-            AllocateAndCopyFrom(other.begin(), other.size())) {}
-
-  ImmutableVector& operator=(const ImmutableVector& other) {
-    if (this != &other) {
-      this->~ImmutableVector();
-      new (this) ImmutableVector(other);
-    }
-    return *this;
-  }
-
-  // Move operations
-  ImmutableVector(ImmutableVector&& other) noexcept {
-    this->header_ = other.header_;
-    other.header_ = nullptr;
-  }
-
-  ImmutableVector& operator=(ImmutableVector&& other) noexcept {
-    if (this != &other) {
-      this->~ImmutableVector();
-      new (this) ImmutableVector(std::move(other));
-    }
-    return *this;
-  }
-
-  // Destructor
-  ~ImmutableVector() {
-    if (this->header_) {
-      auto* cur = &(this->header_->item0);
-      auto* limit = cur + this->size();
-      while (cur != limit) {
-        (*cur).~T();
-        cur++;
-      }
-      Allocator::Free(this->header_);
-    }
-  }
-
- protected:
-  friend class ImmutableVectorView<T>;
-
-  using Header = typename ImmutableVectorView<T>::Header;
-
-  // Don't use std::max() here to avoid including <algorithm> which is massive.
-  static constexpr size_t kAlignment = alignof(T) > alignof(Header)
-                                           ? alignof(T)
-                                           : alignof(Header);
-
-  using Allocator = AlignedAlloc<kAlignment>;
-
-  static Header* AllocateFor(size_t count) {
-    if (!count)
-      return nullptr;
-
-    auto* header = reinterpret_cast<Header*>(
-        Allocator::Alloc(sizeof(Header) + (count - 1u) * sizeof(T)));
-    header->size = count;
-    return header;
-  }
-
-  static Header* AllocateAndCopyFrom(const T* begin, size_t size) {
-    Header* header = AllocateFor(size);
-    if (size) {
-      T* dst = &(header->item0);
-      T* limit = dst + size;
-      for (; dst != limit; ++dst, ++begin)
-        new (dst) T(*begin);
-    }
-    return header;
-  }
-};
-
-#endif  // TOOLS_GN_IMMUTABLE_VECTOR_H_
diff --git a/src/gn/immutable_vector_unittest.cc b/src/gn/immutable_vector_unittest.cc
deleted file mode 100644
index 3561ed2..0000000
--- a/src/gn/immutable_vector_unittest.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gn/immutable_vector.h"
-#include "util/test/test.h"
-
-#include <set>
-#include <vector>
-
-TEST(ImmutableVector, CreationDestruction) {
-  ImmutableVector<int> empty;
-  EXPECT_TRUE(empty.empty());
-  EXPECT_EQ(0u, empty.size());
-
-  ImmutableVector<int> vec1 = {100, 42};
-  EXPECT_FALSE(vec1.empty());
-  EXPECT_EQ(2u, vec1.size());
-  EXPECT_EQ(100, vec1.front());
-  EXPECT_EQ(42, vec1.back());
-  EXPECT_EQ(100, vec1[0]);
-  EXPECT_EQ(42, vec1[1]);
-  EXPECT_TRUE(vec1.begin());
-  EXPECT_TRUE(vec1.end());
-  EXPECT_NE(vec1.begin(), vec1.end());
-  EXPECT_EQ(vec1.begin() + 2, vec1.end());
-
-  std::vector<int> input;
-  input.push_back(100);
-  input.push_back(42);
-  input.push_back(-12);
-  ImmutableVector<int> vec2(input);
-  EXPECT_FALSE(vec2.empty());
-  EXPECT_EQ(3u, vec2.size());
-  EXPECT_EQ(100, vec2.front());
-  EXPECT_EQ(100, vec2[0]);
-  EXPECT_EQ(42, vec2[1]);
-  EXPECT_EQ(-12, vec2[2]);
-  EXPECT_NE(vec2.begin(), &input[0]);
-  EXPECT_NE(vec2.end(), &input[0] + 3);
-}
-
-TEST(ImmutableVetor, InPlaceConstruction) {
-  size_t count = 0;
-  auto count_producer = [&count]() { return count++; };
-  ImmutableVector<int> vec(count_producer, 5u);
-  EXPECT_EQ(5u, vec.size());
-  EXPECT_EQ(0, vec[0]);
-  EXPECT_EQ(1, vec[1]);
-  EXPECT_EQ(2, vec[2]);
-  EXPECT_EQ(3, vec[3]);
-  EXPECT_EQ(4, vec[4]);
-}
-
-TEST(ImmutableVector, CopyAndMoveOperations) {
-  ImmutableVector<int> vec1 = {1, 2, 3, 4};
-  ImmutableVector<int> vec2 = vec1;
-  ImmutableVector<int> vec3 = std::move(vec1);
-
-  EXPECT_TRUE(vec1.empty());
-  EXPECT_EQ(4u, vec2.size());
-  EXPECT_EQ(4u, vec3.size());
-  EXPECT_NE(vec2.begin(), vec3.begin());
-  EXPECT_NE(vec2.end(), vec3.end());
-  EXPECT_TRUE(std::equal(vec2.begin(), vec2.end(), vec3.begin(), vec3.end()));
-}
-
-TEST(ImmutableVectorView, Creation) {
-  ImmutableVector<int> vec1 = {1, 3, 5, 7};
-  ImmutableVectorView<int> view1 = vec1;
-  ImmutableVectorView<int> view2(view1);
-
-  EXPECT_EQ(vec1.size(), view1.size());
-  EXPECT_EQ(vec1.size(), view2.size());
-
-  EXPECT_EQ(vec1.begin(), view1.begin());
-  EXPECT_EQ(vec1.end(), view1.end());
-
-  EXPECT_EQ(vec1.begin(), view2.begin());
-  EXPECT_EQ(vec1.end(), view2.end());
-}
diff --git a/src/gn/resolved_target_data.cc b/src/gn/resolved_target_data.cc
deleted file mode 100644
index 93064f9..0000000
--- a/src/gn/resolved_target_data.cc
+++ /dev/null
@@ -1,461 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gn/resolved_target_data.h"
-
-#include "gn/config_values_extractors.h"
-#include "gn/resolved_target_deps.h"
-
-using LibInfo = ResolvedTargetData::LibInfo;
-using FrameworkInfo = ResolvedTargetData::FrameworkInfo;
-
-namespace {
-
-struct TargetInfo {
-  TargetInfo() = default;
-
-  TargetInfo(const Target* target)
-      : target(target),
-        deps(target->public_deps(),
-             target->private_deps(),
-             target->data_deps()) {}
-
-  const Target* target = nullptr;
-  ResolvedTargetDeps deps;
-
-  bool has_lib_info = false;
-  bool has_framework_info = false;
-  bool has_hard_deps = false;
-  bool has_inherited_libs = false;
-  bool has_rust_libs = false;
-
-  // Only valid if |has_lib_info|.
-  ImmutableVector<SourceDir> lib_dirs;
-  ImmutableVector<LibFile> libs;
-
-  // Only valid if |has_framework_info|.
-  ImmutableVector<SourceDir> framework_dirs;
-  ImmutableVector<std::string> frameworks;
-  ImmutableVector<std::string> weak_frameworks;
-
-  // Only valid if |has_hard_deps|.
-  ImmutableVector<const Target*> hard_deps;
-
-  // Only valid if |has_inherited_libs|.
-  ImmutableVector<TargetPublicPair> inherited_libs;
-
-  // Only valid if |has_rust_libs|.
-  ImmutableVector<TargetPublicPair> rust_inherited_libs;
-  ImmutableVector<TargetPublicPair> rust_inheritable_libs;
-};
-
-}  // namespace
-
-// Implementation class for ResolvedTargetData.
-class ResolvedTargetData::Impl {
- public:
-  LibInfo GetLibInfo(const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetLibInfo(target);
-    DCHECK(info->has_lib_info);
-    return LibInfo{
-        info->lib_dirs,
-        info->libs,
-    };
-  }
-
-  ImmutableVectorView<SourceDir> all_lib_dirs(const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetLibInfo(target);
-    DCHECK(info->has_lib_info);
-    return info->lib_dirs;
-  }
-
-  ImmutableVectorView<LibFile> all_libs(const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetLibInfo(target);
-    DCHECK(info->has_lib_info);
-    return info->libs;
-  }
-
-  FrameworkInfo GetFrameworkInfo(const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetFrameworkInfo(target);
-    DCHECK(info->has_framework_info);
-    return FrameworkInfo{
-        info->framework_dirs,
-        info->frameworks,
-        info->weak_frameworks,
-    };
-  }
-
-  ImmutableVectorView<SourceDir> all_framework_dirs(
-      const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetFrameworkInfo(target);
-    DCHECK(info->has_framework_info);
-    return info->framework_dirs;
-  }
-
-  ImmutableVectorView<std::string> all_frameworks(const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetFrameworkInfo(target);
-    DCHECK(info->has_framework_info);
-    return info->frameworks;
-  }
-
-  ImmutableVectorView<std::string> all_weak_frameworks(
-      const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetFrameworkInfo(target);
-    DCHECK(info->has_framework_info);
-    return info->weak_frameworks;
-  }
-
-  TargetSet recursive_hard_deps(const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    DCHECK(info->has_hard_deps);
-    if (!info->has_hard_deps)
-      ComputeHardDeps(info);
-
-    return TargetSet(info->hard_deps.begin(), info->hard_deps.end());
-  }
-
-  ImmutableVectorView<TargetPublicPair> inherited_libraries(
-      const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetInheritedLibs(target);
-    DCHECK(info->has_inherited_libs);
-    return info->inherited_libs;
-  }
-
-  ImmutableVectorView<TargetPublicPair> rust_transitive_inherited_libs(
-      const Target* target) const {
-    const TargetInfo* info = GetRecursiveTargetRustLibs(target);
-    DCHECK(info->has_rust_libs);
-    return info->rust_inherited_libs;
-  }
-
- private:
-  const TargetInfo* GetRecursiveTargetLibInfo(const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    if (!info->has_lib_info)
-      ComputeLibInfo(info);
-    return info;
-  }
-
-  void ComputeLibInfo(TargetInfo* info) const {
-    UniqueVector<SourceDir> all_lib_dirs;
-    UniqueVector<LibFile> all_libs;
-
-    for (ConfigValuesIterator iter(info->target); !iter.done(); iter.Next()) {
-      const ConfigValues& cur = iter.cur();
-      all_lib_dirs.Append(cur.lib_dirs());
-      all_libs.Append(cur.libs());
-    }
-    for (const Target* dep : info->deps.linked_deps()) {
-      if (!dep->IsFinal() || dep->output_type() == Target::STATIC_LIBRARY) {
-        const TargetInfo* dep_info = GetRecursiveTargetLibInfo(dep);
-        all_lib_dirs.Append(dep_info->lib_dirs);
-        all_libs.Append(dep_info->libs);
-      }
-    }
-
-    info->lib_dirs = ImmutableVector<SourceDir>(all_lib_dirs.release());
-    info->libs = ImmutableVector<LibFile>(all_libs.release());
-    info->has_lib_info = true;
-  }
-
-  const TargetInfo* GetRecursiveTargetFrameworkInfo(
-      const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    if (!info->has_framework_info)
-      ComputeFrameworkInfo(info);
-    return info;
-  }
-
-  void ComputeFrameworkInfo(TargetInfo* info) const {
-    UniqueVector<SourceDir> all_framework_dirs;
-    UniqueVector<std::string> all_frameworks;
-    UniqueVector<std::string> all_weak_frameworks;
-
-    for (ConfigValuesIterator iter(info->target); !iter.done(); iter.Next()) {
-      const ConfigValues& cur = iter.cur();
-      all_framework_dirs.Append(cur.framework_dirs());
-      all_frameworks.Append(cur.frameworks());
-      all_weak_frameworks.Append(cur.weak_frameworks());
-    }
-    for (const Target* dep : info->deps.linked_deps()) {
-      if (!dep->IsFinal() || dep->output_type() == Target::STATIC_LIBRARY) {
-        const TargetInfo* dep_info = GetRecursiveTargetLibInfo(dep);
-        all_framework_dirs.Append(dep_info->framework_dirs);
-        all_frameworks.Append(dep_info->frameworks);
-        all_weak_frameworks.Append(dep_info->weak_frameworks);
-      }
-    }
-
-    info->framework_dirs = ImmutableVector<SourceDir>(all_framework_dirs);
-    info->frameworks = ImmutableVector<std::string>(all_frameworks);
-    info->weak_frameworks = ImmutableVector<std::string>(all_weak_frameworks);
-    info->has_framework_info = true;
-  }
-
-  const TargetInfo* GetRecursiveTargetHardDeps(const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    if (!info->has_hard_deps)
-      ComputeHardDeps(info);
-    return info;
-  }
-
-  void ComputeHardDeps(TargetInfo* info) const {
-    TargetSet all_hard_deps;
-    for (const Target* dep : info->deps.linked_deps()) {
-      // Direct hard dependencies
-      if (info->target->hard_dep() || dep->hard_dep()) {
-        all_hard_deps.insert(dep);
-        continue;
-      }
-      // If |dep| is binary target and |dep| has no public header,
-      // |this| target does not need to have |dep|'s hard_deps as its
-      // hard_deps to start compiles earlier. Unless the target compiles a
-      // Swift module (since they also generate a header that can be used
-      // by the current target).
-      if (dep->IsBinary() && !dep->all_headers_public() &&
-          dep->public_headers().empty() && !dep->builds_swift_module()) {
-        continue;
-      }
-
-      // Recursive hard dependencies of all dependencies.
-      const TargetInfo* dep_info = GetRecursiveTargetHardDeps(dep);
-      all_hard_deps.insert(dep_info->hard_deps.begin(),
-                           dep_info->hard_deps.end());
-    }
-    info->hard_deps = ImmutableVector<const Target*>(all_hard_deps);
-    info->has_hard_deps = true;
-  }
-
-  const TargetInfo* GetRecursiveTargetInheritedLibs(
-      const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    if (!info->has_inherited_libs)
-      ComputeInheritedLibs(info);
-    return info;
-  }
-
-  void ComputeInheritedLibs(TargetInfo* info) const {
-    TargetPublicPairListBuilder inherited_libraries;
-
-    ComputeInheritedLibsFor(info->deps.public_deps(), true,
-                            &inherited_libraries);
-    ComputeInheritedLibsFor(info->deps.private_deps(), false,
-                            &inherited_libraries);
-
-    info->has_inherited_libs = true;
-    info->inherited_libs = inherited_libraries.Build();
-  }
-
-  void ComputeInheritedLibsFor(
-      base::span<const Target*> deps,
-      bool is_public,
-      TargetPublicPairListBuilder* inherited_libraries) const {
-    for (const Target* dep : deps) {
-      // Direct dependent libraries.
-      if (dep->output_type() == Target::STATIC_LIBRARY ||
-          dep->output_type() == Target::SHARED_LIBRARY ||
-          dep->output_type() == Target::RUST_LIBRARY ||
-          dep->output_type() == Target::SOURCE_SET ||
-          (dep->output_type() == Target::CREATE_BUNDLE &&
-           dep->bundle_data().is_framework())) {
-        inherited_libraries->Append(dep, is_public);
-      }
-      if (dep->output_type() == Target::SHARED_LIBRARY) {
-        // Shared library dependendencies are inherited across public shared
-        // library boundaries.
-        //
-        // In this case:
-        //   EXE -> INTERMEDIATE_SHLIB --[public]--> FINAL_SHLIB
-        // The EXE will also link to to FINAL_SHLIB. The public dependency means
-        // that the EXE can use the headers in FINAL_SHLIB so the FINAL_SHLIB
-        // will need to appear on EXE's link line.
-        //
-        // However, if the dependency is private:
-        //   EXE -> INTERMEDIATE_SHLIB --[private]--> FINAL_SHLIB
-        // the dependency will not be propagated because INTERMEDIATE_SHLIB is
-        // not granting permission to call functions from FINAL_SHLIB. If EXE
-        // wants to use functions (and link to) FINAL_SHLIB, it will need to do
-        // so explicitly.
-        //
-        // Static libraries and source sets aren't inherited across shared
-        // library boundaries because they will be linked into the shared
-        // library. Rust dylib deps are handled above and transitive deps are
-        // resolved by the compiler.
-        const TargetInfo* dep_info = GetRecursiveTargetInheritedLibs(dep);
-        for (const auto& pair : dep_info->inherited_libs) {
-          if (pair.target()->output_type() == Target::SHARED_LIBRARY &&
-              pair.is_public()) {
-            inherited_libraries->Append(pair.target(), is_public);
-          }
-        }
-      } else if (!dep->IsFinal()) {
-        // The current target isn't linked, so propagate linked deps and
-        // libraries up the dependency tree.
-        const TargetInfo* dep_info = GetRecursiveTargetInheritedLibs(dep);
-        for (const auto& pair : dep_info->inherited_libs) {
-          // Proc macros are not linked into targets that depend on them, so do
-          // not get inherited; they are consumed by the Rust compiler and only
-          // need to be specified in --extern.
-          if (pair.target()->output_type() != Target::RUST_PROC_MACRO)
-            inherited_libraries->Append(pair.target(),
-                                        is_public && pair.is_public());
-        }
-      } else if (dep->complete_static_lib()) {
-        // Inherit only final targets through _complete_ static libraries.
-        //
-        // Inherited final libraries aren't linked into complete static
-        // libraries. They are forwarded here so that targets that depend on
-        // complete static libraries can link them in. Conversely, since
-        // complete static libraries link in non-final targets they shouldn't be
-        // inherited.
-        const TargetInfo* dep_info = GetRecursiveTargetInheritedLibs(dep);
-        for (const auto& pair : dep_info->inherited_libs) {
-          if (pair.target()->IsFinal())
-            inherited_libraries->Append(pair.target(),
-                                        is_public && pair.is_public());
-        }
-      }
-    }
-  }
-
-  const TargetInfo* GetRecursiveTargetRustLibs(const Target* target) const {
-    TargetInfo* info = GetInfo(target);
-    if (!info->has_rust_libs)
-      ComputeRustLibs(info);
-    return info;
-  }
-
-  struct RustLibsBuilder {
-    TargetPublicPairListBuilder inherited;
-    TargetPublicPairListBuilder inheritable;
-  };
-
-  void ComputeRustLibs(TargetInfo* info) const {
-    RustLibsBuilder rust_libs;
-
-    ComputeRustLibsFor(info->deps.public_deps(), true, &rust_libs);
-    ComputeRustLibsFor(info->deps.private_deps(), false, &rust_libs);
-
-    info->has_rust_libs = true;
-    info->rust_inherited_libs = rust_libs.inherited.Build();
-    info->rust_inheritable_libs = rust_libs.inheritable.Build();
-  }
-
-  void ComputeRustLibsFor(base::span<const Target*> deps,
-                          bool is_public,
-                          RustLibsBuilder* rust_libs) const {
-    for (const Target* dep : deps) {
-      // Collect Rust libraries that are accessible from the current target, or
-      // transitively part of the current target.
-      if (dep->output_type() == Target::STATIC_LIBRARY ||
-          dep->output_type() == Target::SHARED_LIBRARY ||
-          dep->output_type() == Target::SOURCE_SET ||
-          dep->output_type() == Target::RUST_LIBRARY ||
-          dep->output_type() == Target::GROUP) {
-        // Here we have: `this` --[depends-on]--> `dep`
-        //
-        // The `this` target has direct access to `dep` since its a direct
-        // dependency, regardless of the edge being a public_dep or not, so we
-        // pass true for public-ness. Whereas, anything depending on `this` can
-        // only gain direct access to `dep` if the edge between `this` and `dep`
-        // is public, so we pass `is_public`.
-        //
-        // TODO(danakj): We should only need to track Rust rlibs or dylibs here,
-        // as it's used for passing to rustc with --extern. We currently track
-        // everything then drop non-Rust libs in
-        // ninja_rust_binary_target_writer.cc.
-        rust_libs->inherited.Append(dep, true);
-        rust_libs->inheritable.Append(dep, is_public);
-
-        const TargetInfo* dep_info = GetRecursiveTargetRustLibs(dep);
-        rust_libs->inherited.AppendInherited(dep_info->rust_inheritable_libs,
-                                             true);
-        rust_libs->inheritable.AppendInherited(dep_info->rust_inheritable_libs,
-                                               is_public);
-      } else if (dep->output_type() == Target::RUST_PROC_MACRO) {
-        // Proc-macros are inherited as a transitive dependency, but the things
-        // they depend on can't be used elsewhere, as the proc macro is not
-        // linked into the target (as it's only used during compilation).
-        rust_libs->inherited.Append(dep, true);
-        rust_libs->inheritable.Append(dep, is_public);
-      }
-    }
-  }
-
-  TargetInfo* GetInfo(const Target* target) const {
-    auto ret = targets_.PushBackWithIndex(target);
-    if (!ret.first)
-      return infos_[ret.second].get();
-
-    infos_.push_back(std::make_unique<TargetInfo>(target));
-    return infos_.back().get();
-  }
-
-  // A { target -> TargetInfo } map that will create entries
-  // on demand. Implemented with a UniqueVector<> and a parallel
-  // vector of unique TargetInfo instances for best performance.
-  mutable UniqueVector<const Target*> targets_;
-  mutable std::vector<std::unique_ptr<TargetInfo>> infos_;
-};
-
-ResolvedTargetData::ResolvedTargetData() = default;
-
-ResolvedTargetData::~ResolvedTargetData() = default;
-
-ResolvedTargetData::ResolvedTargetData(ResolvedTargetData&&) noexcept = default;
-ResolvedTargetData& ResolvedTargetData::operator=(ResolvedTargetData&&) =
-    default;
-
-ResolvedTargetData::Impl* ResolvedTargetData::GetImpl() const {
-  if (!impl_)
-    impl_ = std::make_unique<ResolvedTargetData::Impl>();
-  return impl_.get();
-}
-
-LibInfo ResolvedTargetData::GetLibInfo(const Target* target) const {
-  return GetImpl()->GetLibInfo(target);
-}
-
-ImmutableVectorView<SourceDir> ResolvedTargetData::all_lib_dirs(
-    const Target* target) const {
-  return GetImpl()->all_lib_dirs(target);
-}
-
-ImmutableVectorView<LibFile> ResolvedTargetData::all_libs(
-    const Target* target) const {
-  return GetImpl()->all_libs(target);
-}
-
-FrameworkInfo ResolvedTargetData::GetFrameworkInfo(const Target* target) const {
-  return GetImpl()->GetFrameworkInfo(target);
-}
-
-ImmutableVectorView<SourceDir> ResolvedTargetData::all_framework_dirs(
-    const Target* target) const {
-  return GetImpl()->all_framework_dirs(target);
-}
-
-ImmutableVectorView<std::string> ResolvedTargetData::all_frameworks(
-    const Target* target) const {
-  return GetImpl()->all_frameworks(target);
-}
-
-ImmutableVectorView<std::string> ResolvedTargetData::all_weak_frameworks(
-    const Target* target) const {
-  return GetImpl()->all_weak_frameworks(target);
-}
-
-TargetSet ResolvedTargetData::recursive_hard_deps(const Target* target) const {
-  return GetImpl()->recursive_hard_deps(target);
-}
-
-TargetPublicPairList ResolvedTargetData::inherited_libraries(
-    const Target* target) const {
-  return GetImpl()->inherited_libraries(target);
-}
-
-TargetPublicPairList ResolvedTargetData::rust_transitive_inherited_libs(
-    const Target* target) const {
-  return GetImpl()->rust_transitive_inherited_libs(target);
-}
diff --git a/src/gn/resolved_target_data.h b/src/gn/resolved_target_data.h
deleted file mode 100644
index 67a616f..0000000
--- a/src/gn/resolved_target_data.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_GN_RESOLVED_TARGET_DATA_H_
-#define TOOLS_GN_RESOLVED_TARGET_DATA_H_
-
-#include <memory>
-
-#include "gn/immutable_vector.h"
-#include "gn/lib_file.h"
-#include "gn/source_dir.h"
-#include "gn/tagged_pointer.h"
-#include "gn/target.h"
-#include "gn/target_public_pair.h"
-
-class Target;
-
-// A list of (target_ptr, is_public_flag) pairs as returned by methods
-// of ResolvedTargetData.
-using TargetPublicPairList = ImmutableVectorView<TargetPublicPair>;
-
-// A class used to compute data.
-class ResolvedTargetData {
- public:
-  ResolvedTargetData();
-  ~ResolvedTargetData();
-
-  // Move operations
-  ResolvedTargetData(ResolvedTargetData&&) noexcept;
-  ResolvedTargetData& operator=(ResolvedTargetData&&);
-
-  // Retrieve information about link-time libraries needed by this target.
-  struct LibInfo {
-    ImmutableVectorView<SourceDir> all_lib_dirs;
-    ImmutableVectorView<LibFile> all_libs;
-  };
-  LibInfo GetLibInfo(const Target*) const;
-
-  ImmutableVectorView<SourceDir> all_lib_dirs(const Target* target) const;
-
-  ImmutableVectorView<LibFile> all_libs(const Target* target) const;
-
-  // Retrieve information about link-time OS X frameworks needed by this target.
-  struct FrameworkInfo {
-    ImmutableVector<SourceDir> all_framework_dirs;
-    ImmutableVector<std::string> all_frameworks;
-    ImmutableVector<std::string> all_weak_frameworks;
-  };
-  FrameworkInfo GetFrameworkInfo(const Target* target) const;
-
-  ImmutableVectorView<SourceDir> all_framework_dirs(const Target* target) const;
-
-  ImmutableVectorView<std::string> all_frameworks(const Target* target) const;
-
-  ImmutableVectorView<std::string> all_weak_frameworks(
-      const Target* target) const;
-
-  // Retrieve a set of hard dependencies for this target.
-  TargetSet recursive_hard_deps(const Target* target) const;
-
-  // Retrieve an ordered list of (target, is_public) pairs for all link-time
-  // libraries inherited by this target.
-  TargetPublicPairList inherited_libraries(const Target* target) const;
-
-  // Retrieves an ordered list of (target, is_public) paris for all link-time
-  // libraries for Rust-specific binary targets.
-  TargetPublicPairList rust_transitive_inherited_libs(
-      const Target* target) const;
-
- private:
-  class Impl;
-
-  Impl* GetImpl() const;
-
-  mutable std::unique_ptr<Impl> impl_;
-};
-
-#endif  // TOOLS_GN_RESOLVED_TARGET_DATA_H_
diff --git a/src/gn/resolved_target_data_unittest.cc b/src/gn/resolved_target_data_unittest.cc
deleted file mode 100644
index 1dd4d5a..0000000
--- a/src/gn/resolved_target_data_unittest.cc
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gn/resolved_target_data.h"
-
-#include "gn/test_with_scope.h"
-#include "util/test/test.h"
-
-// Tests that lib[_dir]s are inherited across deps boundaries for static
-// libraries but not executables.
-TEST(ResolvedTargetDataTest, LibInheritance) {
-  TestWithScope setup;
-  Err err;
-
-  ResolvedTargetData resolved;
-
-  const LibFile lib("foo");
-  const SourceDir libdir("/foo_dir/");
-
-  // Leaf target with ldflags set.
-  TestTarget z(setup, "//foo:z", Target::STATIC_LIBRARY);
-  z.config_values().libs().push_back(lib);
-  z.config_values().lib_dirs().push_back(libdir);
-  ASSERT_TRUE(z.OnResolved(&err));
-
-  // All lib[_dir]s should be set when target is resolved.
-  auto z_info = resolved.GetLibInfo(&z);
-  ASSERT_EQ(1u, z_info.all_libs.size());
-  EXPECT_EQ(lib, z_info.all_libs[0]);
-  ASSERT_EQ(1u, z_info.all_lib_dirs.size());
-  EXPECT_EQ(libdir, z_info.all_lib_dirs[0]);
-
-  // Shared library target should inherit the libs from the static library
-  // and its own. Its own flag should be before the inherited one.
-  const LibFile second_lib("bar");
-  const SourceDir second_libdir("/bar_dir/");
-  TestTarget shared(setup, "//foo:shared", Target::SHARED_LIBRARY);
-  shared.config_values().libs().push_back(second_lib);
-  shared.config_values().lib_dirs().push_back(second_libdir);
-  shared.private_deps().push_back(LabelTargetPair(&z));
-  ASSERT_TRUE(shared.OnResolved(&err));
-
-  const auto libinfo = resolved.GetLibInfo(&shared);
-  ASSERT_EQ(2u, libinfo.all_libs.size());
-  EXPECT_EQ(second_lib, libinfo.all_libs[0]);
-  EXPECT_EQ(lib, libinfo.all_libs[1]);
-  ASSERT_EQ(2u, libinfo.all_lib_dirs.size());
-  EXPECT_EQ(second_libdir, libinfo.all_lib_dirs[0]);
-  EXPECT_EQ(libdir, libinfo.all_lib_dirs[1]);
-
-  // Executable target shouldn't get either by depending on shared.
-  TestTarget exec(setup, "//foo:exec", Target::EXECUTABLE);
-  exec.private_deps().push_back(LabelTargetPair(&shared));
-  ASSERT_TRUE(exec.OnResolved(&err));
-  auto exec_libinfo = resolved.GetLibInfo(&exec);
-  EXPECT_EQ(0u, exec_libinfo.all_libs.size());
-  EXPECT_EQ(0u, exec_libinfo.all_lib_dirs.size());
-}
-
-// Tests that framework[_dir]s are inherited across deps boundaries for static
-// libraries but not executables.
-TEST(ResolvedTargetDataTest, FrameworkInheritance) {
-  TestWithScope setup;
-  Err err;
-
-  const std::string framework("Foo.framework");
-  const SourceDir frameworkdir("//out/foo/");
-
-  // Leaf target with ldflags set.
-  TestTarget z(setup, "//foo:z", Target::STATIC_LIBRARY);
-  z.config_values().frameworks().push_back(framework);
-  z.config_values().framework_dirs().push_back(frameworkdir);
-  ASSERT_TRUE(z.OnResolved(&err));
-
-  ResolvedTargetData resolved;
-
-  // All framework[_dir]s should be set when target is resolved.
-  auto info = resolved.GetFrameworkInfo(&z);
-  ASSERT_EQ(1u, info.all_frameworks.size());
-  EXPECT_EQ(framework, info.all_frameworks[0]);
-  ASSERT_EQ(1u, info.all_framework_dirs.size());
-  EXPECT_EQ(frameworkdir, info.all_framework_dirs[0]);
-
-  // Shared library target should inherit the libs from the static library
-  // and its own. Its own flag should be before the inherited one.
-  const std::string second_framework("Bar.framework");
-  const SourceDir second_frameworkdir("//out/bar/");
-  TestTarget shared(setup, "//foo:shared", Target::SHARED_LIBRARY);
-  shared.config_values().frameworks().push_back(second_framework);
-  shared.config_values().framework_dirs().push_back(second_frameworkdir);
-  shared.private_deps().push_back(LabelTargetPair(&z));
-  ASSERT_TRUE(shared.OnResolved(&err));
-
-  auto shared_info = resolved.GetFrameworkInfo(&shared);
-  ASSERT_EQ(2u, shared_info.all_frameworks.size());
-  EXPECT_EQ(second_framework, shared_info.all_frameworks[0]);
-  EXPECT_EQ(framework, shared_info.all_frameworks[1]);
-  ASSERT_EQ(2u, shared_info.all_framework_dirs.size());
-  EXPECT_EQ(second_frameworkdir, shared_info.all_framework_dirs[0]);
-  EXPECT_EQ(frameworkdir, shared_info.all_framework_dirs[1]);
-
-  // Executable target shouldn't get either by depending on shared.
-  TestTarget exec(setup, "//foo:exec", Target::EXECUTABLE);
-  exec.private_deps().push_back(LabelTargetPair(&shared));
-  ASSERT_TRUE(exec.OnResolved(&err));
-  auto exec_info = resolved.GetFrameworkInfo(&exec);
-  EXPECT_EQ(0u, exec_info.all_frameworks.size());
-  EXPECT_EQ(0u, exec_info.all_framework_dirs.size());
-}
-
-TEST(ResolvedTargetDataTest, InheritLibs) {
-  TestWithScope setup;
-  Err err;
-
-  // Create a dependency chain:
-  //   A (executable) -> B (shared lib) -> C (static lib) -> D (source set)
-  TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-  TestTarget b(setup, "//foo:b", Target::SHARED_LIBRARY);
-  TestTarget c(setup, "//foo:c", Target::STATIC_LIBRARY);
-  TestTarget d(setup, "//foo:d", Target::SOURCE_SET);
-  a.private_deps().push_back(LabelTargetPair(&b));
-  b.private_deps().push_back(LabelTargetPair(&c));
-  c.private_deps().push_back(LabelTargetPair(&d));
-
-  ASSERT_TRUE(d.OnResolved(&err));
-  ASSERT_TRUE(c.OnResolved(&err));
-  ASSERT_TRUE(b.OnResolved(&err));
-  ASSERT_TRUE(a.OnResolved(&err));
-
-  ResolvedTargetData resolved;
-
-  // C should have D in its inherited libs.
-  auto c_inherited_libs = resolved.inherited_libraries(&c);
-  ASSERT_EQ(1u, c_inherited_libs.size());
-  EXPECT_EQ(&d, c_inherited_libs[0].target());
-
-  // B should have C and D in its inherited libs.
-  auto b_inherited = resolved.inherited_libraries(&b);
-  ASSERT_EQ(2u, b_inherited.size());
-  EXPECT_EQ(&c, b_inherited[0].target());
-  EXPECT_EQ(&d, b_inherited[1].target());
-
-  // A should have B in its inherited libs, but not any others (the shared
-  // library will include the static library and source set).
-  auto a_inherited = resolved.inherited_libraries(&a);
-  ASSERT_EQ(1u, a_inherited.size());
-  EXPECT_EQ(&b, a_inherited[0].target());
-}
-
-TEST(ResolvedTargetData, NoActionDepPropgation) {
-  TestWithScope setup;
-  Err err;
-  ResolvedTargetData resolved;
-  // Create a dependency chain:
-  //   A (exe) -> B (action) -> C (source_set)
-  {
-    TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-    TestTarget b(setup, "//foo:b", Target::ACTION);
-    TestTarget c(setup, "//foo:c", Target::SOURCE_SET);
-
-    a.private_deps().push_back(LabelTargetPair(&b));
-    b.private_deps().push_back(LabelTargetPair(&c));
-
-    ASSERT_TRUE(c.OnResolved(&err));
-    ASSERT_TRUE(b.OnResolved(&err));
-    ASSERT_TRUE(a.OnResolved(&err));
-
-    // The executable should not have inherited the source set across the
-    // action.
-    ASSERT_TRUE(resolved.inherited_libraries(&a).empty());
-  }
-}
-
-TEST(ResolvedTargetDataTest, InheritCompleteStaticLib) {
-  TestWithScope setup;
-  Err err;
-
-  ResolvedTargetData resolved;
-
-  // Create a dependency chain:
-  //   A (executable) -> B (complete static lib) -> C (source set)
-  TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-  TestTarget b(setup, "//foo:b", Target::STATIC_LIBRARY);
-  b.set_complete_static_lib(true);
-
-  const LibFile lib("foo");
-  const SourceDir lib_dir("/foo_dir/");
-  TestTarget c(setup, "//foo:c", Target::SOURCE_SET);
-  c.config_values().libs().push_back(lib);
-  c.config_values().lib_dirs().push_back(lib_dir);
-
-  a.public_deps().push_back(LabelTargetPair(&b));
-  b.public_deps().push_back(LabelTargetPair(&c));
-
-  ASSERT_TRUE(c.OnResolved(&err));
-  ASSERT_TRUE(b.OnResolved(&err));
-  ASSERT_TRUE(a.OnResolved(&err));
-
-  // B should have C in its inherited libs.
-  auto b_inherited = resolved.inherited_libraries(&b);
-  ASSERT_EQ(1u, b_inherited.size());
-  EXPECT_EQ(&c, b_inherited[0].target());
-
-  // A should have B in its inherited libs, but not any others (the complete
-  // static library will include the source set).
-  auto a_inherited = resolved.inherited_libraries(&a);
-  ASSERT_EQ(1u, a_inherited.size());
-  EXPECT_EQ(&b, a_inherited[0].target());
-
-  // A should inherit the libs and lib_dirs from the C.
-  auto a_info = resolved.GetLibInfo(&a);
-  ASSERT_EQ(1u, a_info.all_libs.size());
-  EXPECT_EQ(lib, a_info.all_libs[0]);
-  ASSERT_EQ(1u, a_info.all_lib_dirs.size());
-  EXPECT_EQ(lib_dir, a_info.all_lib_dirs[0]);
-}
-
-TEST(ResolvedTargetDataTest, InheritCompleteStaticLibStaticLibDeps) {
-  TestWithScope setup;
-  Err err;
-
-  // Create a dependency chain:
-  //   A (executable) -> B (complete static lib) -> C (static lib)
-  TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-  TestTarget b(setup, "//foo:b", Target::STATIC_LIBRARY);
-  b.set_complete_static_lib(true);
-  TestTarget c(setup, "//foo:c", Target::STATIC_LIBRARY);
-  a.public_deps().push_back(LabelTargetPair(&b));
-  b.public_deps().push_back(LabelTargetPair(&c));
-
-  ASSERT_TRUE(c.OnResolved(&err));
-  ASSERT_TRUE(b.OnResolved(&err));
-  ASSERT_TRUE(a.OnResolved(&err));
-
-  ResolvedTargetData resolved;
-
-  // B should have C in its inherited libs.
-  auto b_inherited = resolved.inherited_libraries(&b);
-  ASSERT_EQ(1u, b_inherited.size());
-  EXPECT_EQ(&c, b_inherited[0].target());
-
-  // A should have B in its inherited libs, but not any others (the complete
-  // static library will include the static library).
-  auto a_inherited = resolved.inherited_libraries(&a);
-  ASSERT_EQ(1u, a_inherited.size());
-  EXPECT_EQ(&b, a_inherited[0].target());
-}
-
-TEST(ResolvedTargetDataTest,
-     InheritCompleteStaticLibInheritedCompleteStaticLibDeps) {
-  TestWithScope setup;
-  Err err;
-
-  // Create a dependency chain:
-  //   A (executable) -> B (complete static lib) -> C (complete static lib)
-  TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-  TestTarget b(setup, "//foo:b", Target::STATIC_LIBRARY);
-  b.set_complete_static_lib(true);
-  TestTarget c(setup, "//foo:c", Target::STATIC_LIBRARY);
-  c.set_complete_static_lib(true);
-
-  a.private_deps().push_back(LabelTargetPair(&b));
-  b.private_deps().push_back(LabelTargetPair(&c));
-
-  ASSERT_TRUE(c.OnResolved(&err));
-  ASSERT_TRUE(b.OnResolved(&err));
-  ASSERT_TRUE(a.OnResolved(&err));
-
-  ResolvedTargetData resolved;
-
-  // B should have C in its inherited libs.
-  auto b_inherited = resolved.inherited_libraries(&b);
-  ASSERT_EQ(1u, b_inherited.size());
-  EXPECT_EQ(&c, b_inherited[0].target());
-
-  // A should have B and C in its inherited libs.
-  auto a_inherited = resolved.inherited_libraries(&a);
-  ASSERT_EQ(2u, a_inherited.size());
-  EXPECT_EQ(&b, a_inherited[0].target());
-  EXPECT_EQ(&c, a_inherited[1].target());
-}
-
-TEST(ResolvedTargetDataTest, NoActionDepPropgation) {
-  TestWithScope setup;
-  Err err;
-  ResolvedTargetData resolved;
-
-  // Create a dependency chain:
-  //   A (exe) -> B (action) -> C (source_set)
-  {
-    TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
-    TestTarget b(setup, "//foo:b", Target::ACTION);
-    TestTarget c(setup, "//foo:c", Target::SOURCE_SET);
-
-    a.private_deps().push_back(LabelTargetPair(&b));
-    b.private_deps().push_back(LabelTargetPair(&c));
-
-    ASSERT_TRUE(c.OnResolved(&err));
-    ASSERT_TRUE(b.OnResolved(&err));
-    ASSERT_TRUE(a.OnResolved(&err));
-
-    // The executable should not have inherited the source set across the
-    // action.
-    auto libs = resolved.inherited_libraries(&a);
-    ASSERT_TRUE(libs.empty());
-  }
-}
diff --git a/src/gn/resolved_target_deps.h b/src/gn/resolved_target_deps.h
deleted file mode 100644
index 5d3903a..0000000
--- a/src/gn/resolved_target_deps.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_GN_RESOLVED_TARGET_DEPS_H_
-#define TOOLS_GN_RESOLVED_TARGET_DEPS_H_
-
-#include "base/containers/span.h"
-#include "gn/label_ptr.h"
-
-#include <memory>
-
-// A class used to record the dependencies of a given Target in
-// a way that is much more efficient to iterate over than having three
-// separate LabelTargetVector instances. Technically equivalent to
-// DepsIterator, but profiling shows that this class is much faster
-// to use during graph-traversal heavy operations.
-//
-// Usage is:
-//   1) Create instance, passing const references to the LabelTargetVector
-//      instances for the private, public and data deps for the target.
-//
-//   2) Use private_deps(), public_deps(), data_deps(), linked_deps()
-//      and all_deps() to retrieve spans that cover various subsets of
-//      interests. These can be used directly in for-range loops as in:
-//
-//       for (const Target* target : resolved.linked_deps()) {
-//         ..
-//       }
-//
-class ResolvedTargetDeps {
- public:
-  ResolvedTargetDeps() = default;
-
-  ResolvedTargetDeps(const LabelTargetVector& public_deps,
-                     const LabelTargetVector& private_deps,
-                     const LabelTargetVector& data_deps)
-      : public_count_(static_cast<uint32_t>(public_deps.size())),
-        private_count_(static_cast<uint32_t>(private_deps.size())),
-        data_count_(static_cast<uint32_t>(data_deps.size())),
-        deps_(Allocate(public_deps, private_deps, data_deps)) {}
-
-  size_t size() const { return private_count_ + public_count_ + data_count_; }
-
-  base::span<const Target*> public_deps() const {
-    return {deps_.get(), public_count_};
-  }
-
-  base::span<const Target*> private_deps() const {
-    return {deps_.get() + public_count_, private_count_};
-  }
-
-  base::span<const Target*> data_deps() const {
-    return {deps_.get() + private_count_ + public_count_, data_count_};
-  }
-
-  base::span<const Target*> linked_deps() const {
-    return {deps_.get(), private_count_ + public_count_};
-  }
-
-  base::span<const Target*> all_deps() const {
-    return {deps_.get(), private_count_ + public_count_ + data_count_};
-  }
-
-  static std::unique_ptr<const Target* []> Allocate(
-      const LabelTargetVector& public_deps,
-      const LabelTargetVector& private_deps,
-      const LabelTargetVector& data_deps) {
-    size_t total_size =
-        private_deps.size() + public_deps.size() + data_deps.size();
-    auto result = std::make_unique<const Target*[]>(total_size);
-    const Target** ptr = result.get();
-    for (const auto& pair : public_deps)
-      *ptr++ = pair.ptr;
-    for (const auto& pair : private_deps)
-      *ptr++ = pair.ptr;
-    for (const auto& pair : data_deps)
-      *ptr++ = pair.ptr;
-    return result;
-  }
-
-  private : uint32_t public_count_ = 0;
-  uint32_t private_count_ = 0;
-  uint32_t data_count_ = 0;
-  std::unique_ptr<const Target*[]> deps_;
-};
-
-#endif  // TOOLS_GN_RESOLVED_TARGET_DEPS_H_
diff --git a/src/gn/resolved_target_deps_unittest.cc b/src/gn/resolved_target_deps_unittest.cc
deleted file mode 100644
index 74d623d..0000000
--- a/src/gn/resolved_target_deps_unittest.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gn/resolved_target_deps.h"
-#include "gn/test_with_scope.h"
-#include "util/test/test.h"
-
-TEST(ResolvedTargetDeps, DefaultConstruction) {
-  ResolvedTargetDeps deps;
-  EXPECT_EQ(0u, deps.size());
-  EXPECT_TRUE(deps.public_deps().empty());
-  EXPECT_TRUE(deps.private_deps().empty());
-  EXPECT_TRUE(deps.data_deps().empty());
-  EXPECT_TRUE(deps.linked_deps().empty());
-  EXPECT_TRUE(deps.all_deps().empty());
-}
-
-TEST(ResolvedTargetDeps, Construction) {
-  TestWithScope setup;
-  TestTarget a(setup, "//foo:a", Target::STATIC_LIBRARY);
-  TestTarget b(setup, "//foo:b", Target::SOURCE_SET);
-  TestTarget c(setup, "//foo:c", Target::SOURCE_SET);
-  TestTarget d(setup, "//foo:d", Target::SOURCE_SET);
-  TestTarget e(setup, "//foo:e", Target::EXECUTABLE);
-
-  LabelTargetVector public_vec;
-  LabelTargetVector private_vec;
-  LabelTargetVector data_vec;
-
-  public_vec.emplace_back(&a);
-  public_vec.emplace_back(&b);
-  private_vec.emplace_back(&c);
-  private_vec.emplace_back(&d);
-  data_vec.emplace_back(&e);
-
-  ResolvedTargetDeps deps(public_vec, private_vec, data_vec);
-  EXPECT_EQ(5u, deps.size());
-
-  EXPECT_EQ(2u, deps.public_deps().size());
-  EXPECT_EQ(&a, deps.public_deps()[0]);
-  EXPECT_EQ(&b, deps.public_deps()[1]);
-
-  EXPECT_EQ(2u, deps.private_deps().size());
-  EXPECT_EQ(&c, deps.private_deps()[0]);
-  EXPECT_EQ(&d, deps.private_deps()[1]);
-
-  EXPECT_EQ(1u, deps.data_deps().size());
-  EXPECT_EQ(&e, deps.data_deps()[0]);
-
-  EXPECT_EQ(4u, deps.linked_deps().size());
-  EXPECT_EQ(&a, deps.linked_deps()[0]);
-  EXPECT_EQ(&b, deps.linked_deps()[1]);
-  EXPECT_EQ(&c, deps.linked_deps()[2]);
-  EXPECT_EQ(&d, deps.linked_deps()[3]);
-
-  EXPECT_EQ(5u, deps.all_deps().size());
-  EXPECT_EQ(&a, deps.all_deps()[0]);
-  EXPECT_EQ(&b, deps.all_deps()[1]);
-  EXPECT_EQ(&c, deps.all_deps()[2]);
-  EXPECT_EQ(&d, deps.all_deps()[3]);
-  EXPECT_EQ(&e, deps.all_deps()[4]);
-}
diff --git a/src/gn/tagged_pointer.h b/src/gn/tagged_pointer.h
deleted file mode 100644
index df760d1..0000000
--- a/src/gn/tagged_pointer.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_GN_TAGGED_POINTER_H_
-#define TOOLS_GN_TAGGED_POINTER_H_
-
-#include "base/logging.h"
-
-// A TaggedPointer<T.N> is a compact encoding of a (pointer, tag) pair
-// when all |tag| values are guaranteed to be less than N bits long, and
-// all pointer values are guaranteed to be aligned to at least N bits.
-template <typename T, size_t BITS>
-class TaggedPointer {
- public:
-  TaggedPointer() = default;
-  TaggedPointer(T* ptr, unsigned tag)
-      : value_(reinterpret_cast<uintptr_t>(ptr)) {
-    CheckPointerValue(ptr);
-    CheckTagValue(tag);
-    value_ |= static_cast<uintptr_t>(tag);
-  }
-
-  T* ptr() const { return reinterpret_cast<T*>(value_ & ~kTagMask); }
-  unsigned tag() const { return static_cast<unsigned>(value_ & kTagMask); }
-
-  void set_ptr(T* ptr) {
-    CheckPointerValue(ptr);
-    value_ = reinterpret_cast<uintptr_t>(ptr) | (value_ & kTagMask);
-  }
-
-  void set_tag(unsigned tag) {
-    CheckTagValue(tag);
-    value_ = (value_ & ~kTagMask) | tag;
-  }
-
-  bool operator==(TaggedPointer other) const { return value_ == other.value_; }
-
-  bool operator!=(TaggedPointer other) const { return !(*this == other); }
-
-  bool operator<(TaggedPointer other) const { return value_ < other.value_; }
-
- private:
-  static const uintptr_t kTagMask = (uintptr_t(1) << BITS) - 1u;
-
-  static void CheckPointerValue(T* ptr) {
-    DCHECK((reinterpret_cast<uintptr_t>(ptr) & kTagMask) == 0)
-        << "Pointer is not aligned to " << BITS << " bits: " << ptr;
-  }
-  static void CheckTagValue(unsigned tag) {
-    DCHECK(tag <= kTagMask)
-        << "Tag value is larger than " << BITS << " bits: " << tag;
-  }
-
-  uintptr_t value_ = 0;
-};
-
-#endif  // TOOLS_GN_TAGGED_POINTER_H_
diff --git a/src/gn/tagged_pointer_unittest.cc b/src/gn/tagged_pointer_unittest.cc
deleted file mode 100644
index b6d68e5..0000000
--- a/src/gn/tagged_pointer_unittest.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "gn/tagged_pointer.h"
-#include "util/test/test.h"
-
-struct Point {
-  double x;
-  double y;
-};
-
-TEST(TaggedPointer, Creation) {
-  TaggedPointer<Point, 2> ptr;
-
-  EXPECT_FALSE(ptr.ptr());
-  EXPECT_EQ(0u, ptr.tag());
-
-  Point point1 = {1., 2.};
-  TaggedPointer<Point, 2> ptr2(&point1, 2);
-  EXPECT_EQ(&point1, ptr2.ptr());
-  EXPECT_EQ(2u, ptr2.tag());
-}
diff --git a/src/gn/target_public_pair.h b/src/gn/target_public_pair.h
deleted file mode 100644
index c8ff655..0000000
--- a/src/gn/target_public_pair.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_GN_TARGET_PUBLIC_PAIR_H_
-#define TOOLS_GN_TARGET_PUBLIC_PAIR_H_
-
-#include "gn/immutable_vector.h"
-#include "gn/tagged_pointer.h"
-#include "gn/unique_vector.h"
-
-class Target;
-
-// A Compact encoding for a (target_ptr, is_public_flag) pair.
-class TargetPublicPair {
- public:
-  TargetPublicPair() = default;
-  TargetPublicPair(const Target* target, bool is_public)
-      : pair_(target, static_cast<unsigned>(is_public)) {}
-  TargetPublicPair(std::pair<const Target*, bool> pair)
-      : pair_(pair.first, static_cast<unsigned>(pair.second)) {}
-
-  const Target* target() const { return pair_.ptr(); }
-  void set_target(const Target* target) { pair_.set_ptr(target); }
-
-  bool is_public() const { return pair_.tag() != 0; }
-  void set_is_public(bool is_public) { pair_.set_tag(is_public ? 1 : 0); }
-
-  // Utility structs that can be used to instantiante containers
-  // that only use the target for lookups / comparisons. E.g.
-  //
-  //   std::unordered_set<TargetPublicPair,
-  //                      TargetPublicPair::TargetHash,
-  //                      TargetPublicPair::TargetEqualTo>
-  //
-  //   std::set<TargetPublicPair, TargetPublicPair::TargetLess>
-  //
-  struct TargetHash {
-    size_t operator()(TargetPublicPair p) const noexcept {
-      return std::hash<const Target*>()(p.target());
-    }
-  };
-
-  struct TargetEqualTo {
-    bool operator()(TargetPublicPair a, TargetPublicPair b) const noexcept {
-      return a.target() == b.target();
-    }
-  };
-
-  struct TargetLess {
-    bool operator()(TargetPublicPair a, TargetPublicPair b) const noexcept {
-      return a.target() < b.target();
-    }
-  };
-
- private:
-  TaggedPointer<const Target, 1> pair_;
-};
-
-// A helper type to build a list of (target, is_public) pairs, where target
-// pointers are unique. Usage is:
-//
-//   1) Create builder instance.
-//   2) Call Append() or AppendInherited() as many times as necessary.
-//   3) Call Build() to retrieve final list as an immutable vector.
-//
-class TargetPublicPairListBuilder
-    : public UniqueVector<TargetPublicPair,
-                          TargetPublicPair::TargetHash,
-                          TargetPublicPair::TargetEqualTo> {
- public:
-  // Add (target, is_public) to the list being constructed. If the target
-  // was not already in the list, recorded the |is_public| flag as is,
-  // otherwise, set the recorded flag to true only if |is_public| is true, or
-  // don't do anything otherwise.
-  void Append(const Target* target, bool is_public) {
-    auto ret = EmplaceBackWithIndex(target, is_public);
-    if (!ret.first && is_public) {
-      // UniqueVector<T>::operator[]() always returns a const reference
-      // because the returned values are lookup keys in its set-like data
-      // structure (thus modifying them would break its internal consistency).
-      // However, because TargetHash and TargetEqualTo are being used to
-      // instantiate this template, only the target() part of the value must
-      // remain constant, and it is possible to modify the is_public() part
-      // in-place safely.
-      auto* pair = const_cast<TargetPublicPair*>(&(*this)[ret.second]);
-      pair->set_is_public(true);
-    }
-  }
-
-  // Append all pairs from any container with begin() and end() iterators
-  // that dereference to values that convert to a TargetPublicPair value.
-  // If |is_public| is false, the input pair will be appended with the
-  // value of the public flag to false.
-  template <
-      typename C,
-      typename = std::void_t<
-          decltype(static_cast<TargetPublicPair>(*std::declval<C>().begin())),
-          decltype(static_cast<TargetPublicPair>(*std::declval<C>().end()))>>
-  void AppendInherited(const C& other, bool is_public) {
-    for (const auto& pair : other) {
-      Append(pair.target(), is_public && pair.is_public());
-    }
-  }
-
-  ImmutableVector<TargetPublicPair> Build() {
-    return ImmutableVector<TargetPublicPair>(release());
-  }
-};
-
-#endif  // TOOLS_GN_TARGET_PUBLIC_PAIR_H_
diff --git a/src/gn/target_public_pair_unittest.cc b/src/gn/target_public_pair_unittest.cc
deleted file mode 100644
index 8b08a0c..0000000
--- a/src/gn/target_public_pair_unittest.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gn/target_public_pair.h"
-#include "util/test/test.h"
-
-TEST(TargetPublicPairTest, ConstructionAndMutation) {
-  // Fake target pointer values.
-  const auto* a_target = reinterpret_cast<const Target*>(1000);
-  const auto* b_target = reinterpret_cast<const Target*>(2000);
-
-  TargetPublicPair a_pair(a_target, true);
-  EXPECT_EQ(a_target, a_pair.target());
-  EXPECT_TRUE(a_pair.is_public());
-
-  TargetPublicPair b_pair(b_target, false);
-  EXPECT_EQ(b_target, b_pair.target());
-  EXPECT_FALSE(b_pair.is_public());
-
-  a_pair.set_target(b_target);
-  EXPECT_EQ(b_target, a_pair.target());
-  EXPECT_TRUE(a_pair.is_public());
-
-  a_pair.set_is_public(false);
-  EXPECT_EQ(b_target, a_pair.target());
-  EXPECT_FALSE(a_pair.is_public());
-
-  a_pair = TargetPublicPair(a_target, true);
-  EXPECT_EQ(a_target, a_pair.target());
-  EXPECT_TRUE(a_pair.is_public());
-
-  b_pair = std::move(a_pair);
-  EXPECT_EQ(a_target, b_pair.target());
-  EXPECT_TRUE(b_pair.is_public());
-}
-
-TEST(TargetPublicPairTest, Builder) {
-  const auto* a_target = reinterpret_cast<const Target*>(1000);
-  const auto* b_target = reinterpret_cast<const Target*>(2000);
-  TargetPublicPairListBuilder builder;
-
-  builder.Append(a_target, false);
-  builder.Append(b_target, false);
-  builder.Append(a_target, true);
-  builder.Append(b_target, false);
-
-  auto list = builder.Build();
-  EXPECT_EQ(2u, list.size());
-  EXPECT_EQ(a_target, list[0].target());
-  EXPECT_EQ(b_target, list[1].target());
-  EXPECT_TRUE(list[0].is_public());
-  EXPECT_FALSE(list[1].is_public());
-}
diff --git a/src/util/aligned_alloc.h b/src/util/aligned_alloc.h
deleted file mode 100644
index 99ecd29..0000000
--- a/src/util/aligned_alloc.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_UTIL_ALIGNED_ALLOC_H_
-#define TOOLS_UTIL_ALIGNED_ALLOC_H_
-
-#ifdef __APPLE__
-#include <Availability.h>
-#endif
-
-#include <cstdlib>
-
-#define IMPL_ALIGNED_ALLOC_CXX17 1
-#define IMPL_ALIGNED_ALLOC_WIN32 2
-#define IMPL_ALIGNED_ALLOC_POSIX 3
-
-#ifndef IMPL_ALIGNED_ALLOC
-#ifdef _WIN32
-#define IMPL_ALIGNED_ALLOC IMPL_ALIGNED_ALLOC_WIN32
-#elif defined(__APPLE__)
-// Note that aligned_alloc() is only available at runtime starting from
-// OSX 10.15, so use posix_memalign() instead which is more portable.
-#define IMPL_ALIGNED_ALLOC IMPL_ALIGNED_ALLOC_POSIX
-#else
-#define IMPL_ALIGNED_ALLOC IMPL_ALIGNED_ALLOC_CXX17
-#endif
-#endif
-
-#if IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_WIN32
-#include <malloc.h>  // for _aligned_malloc() and _aligned_free()
-#endif
-
-#if IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_POSIX
-#include "base/logging.h"  // for CHECK()
-#endif
-
-// AlignedAlloc<N> provides Alloc() and Free() methods that can be
-// used to allocate and release blocks of heap memory aligned with
-// N bytes.
-//
-// The implementation uses std::aligned_alloc() when it is available,
-// or uses fallbacks otherwise. On Win32, _aligned_malloc() and
-// _aligned_free() are used, while for MacOS releases, ::posix_memaloc()
-// is used.
-template <size_t ALIGNMENT>
-struct AlignedAlloc {
-  static void* Alloc(size_t size) {
-    static_assert((ALIGNMENT & (ALIGNMENT - 1)) == 0,
-                  "ALIGNMENT must be a power of 2");
-#if IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_WIN32
-    return _aligned_malloc(size, ALIGNMENT);
-#elif IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_POSIX
-    void* ptr = nullptr;
-    CHECK(!posix_memalign(&ptr, ALIGNMENT, size));
-    return ptr;
-#else  // IMPL_ALIGNED_ALLOC_CXX17
-    return std::aligned_alloc(ALIGNMENT, size);
-#endif
-  }
-
-  static void Free(void* block) {
-#if IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_WIN32
-    _aligned_free(block);
-#elif IMPL_ALIGNED_ALLOC == IMPL_ALIGNED_ALLOC_POSIX
-    return ::free(block);
-#else
-    // Allocation came from std::aligned_alloc()
-    return std::free(block);
-#endif
-  }
-};
-
-#endif  // TOOLS_UTIL_ALIGNED_ALLOC_H_
diff --git a/src/util/aligned_alloc_unittest.cc b/src/util/aligned_alloc_unittest.cc
deleted file mode 100644
index d41a775..0000000
--- a/src/util/aligned_alloc_unittest.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "util/aligned_alloc.h"
-#include "util/test/test.h"
-
-using AlignedAllocPtrSize = AlignedAlloc<sizeof(void*)>;
-using AlignedAlloc32 = AlignedAlloc<32>;
-
-TEST(AlignedAllocTest, PtrSized) {
-  void* ptr = AlignedAllocPtrSize::Alloc(2 * sizeof(void*));
-  ASSERT_TRUE(ptr);
-  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr) % sizeof(void*), 0u);
-  AlignedAllocPtrSize::Free(ptr);
-}
-
-TEST(AlignedAllocTest, Align32) {
-  void* ptr = AlignedAlloc32::Alloc(64);
-  ASSERT_TRUE(ptr);
-  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr) % 32u, 0u);
-  AlignedAlloc32::Free(ptr);
-}