mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:40:11 +01:00
This extracts the C-string `argv`-like building routine to a more broadly reusable location. It also sinks the verbose logging logic out of it and into the relevant runners. In turn, it simplifies the verbose logging logic significantly. The biggest functional change is removing the implicit synthesis of a tool's `-v` verbose flag from the presence of a `vlog` stream. I thought this would be helpful, but in practice of debugging these layers it has been more of a hindrance than a help -- I pretty often only want verbose logging on one side or the other, and we have ways of explicitly passing a `-v` flag to the underlying tools already. I think my instinct to do this was just wrong, so rip it out and simplify. This does add an unused feature -- prepending a prefix of arguments while building the C-string variant. This isn't used in this PR but will be used in subsequent PRs and it seemed more disruptive to undo that logic and then re-do it in a later PR. Let me know if it's too confusing here. Assisted-by: Gemini Code Assist --------- Co-authored-by: Geoff Romer <gromer@google.com>
22 lines
624 B
C++
22 lines
624 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "toolchain/driver/tool_runner_base.h"
|
|
|
|
#include <array>
|
|
#include <memory>
|
|
#include <optional>
|
|
|
|
#include "common/vlog.h"
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
namespace Carbon {
|
|
|
|
ToolRunnerBase::ToolRunnerBase(const InstallPaths* install_paths,
|
|
llvm::raw_ostream* vlog_stream)
|
|
: installation_(install_paths), vlog_stream_(vlog_stream) {}
|
|
|
|
} // namespace Carbon
|