Refactor InstallPaths API and comments a little. (#4341)

Stemming from #4331, trying to break apart InstallPaths class comments
into three parts:

- Construction semantics, staying in the class comment
  - Trying to refer to methods with more detailed  documentation.
- Install prefix contents, now on `prefix_`
- Install structure, consolidating on `install_dirs`

For code refactoring, `driver()` and `prefix()` were only used by the
install paths test. Rather than having a comment not to use `prefix()`,
this instead extracts it out to a TestPeer model (which we have
elsewhere with `TypedNodesTestPeer`, thus my choice in approaches).
This commit is contained in:
Jon Ross-Perkins
2024-09-26 16:16:53 +00:00
committed by GitHub
parent 7f22a289b9
commit 98e0d22b60
4 changed files with 70 additions and 66 deletions
-7
View File
@@ -146,13 +146,6 @@ auto InstallPaths::CheckMarkerFile() -> void {
}
}
auto InstallPaths::driver() const -> std::string {
llvm::SmallString<256> path(prefix_);
// TODO: Adjust this to work equally well on Windows.
llvm::sys::path::append(path, llvm::sys::path::Style::posix, "bin/carbon");
return path.str().str();
}
auto InstallPaths::core_package() const -> std::string {
llvm::SmallString<256> path(prefix_);
// TODO: Adjust this to work equally well on Windows.