mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 17:52:58 +01:00
This layer allows runtimes to be built on-demand but cached in a consistent and re-usable location on the system. It handles careful filesystem operations to ensure consistency even in the face of multiple versions and build configurations. This addresses a number of TODOs from the initial runtimes building on-demand, and sets the stage to scale up to more runtimes. This doesn't switch on-demand runtimes to be on by default, I wanted to wait and make that change as a separate step. --------- Co-authored-by: Geoff Romer <gromer@google.com>
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
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
|
|
|
|
#ifndef CARBON_TOOLCHAIN_DRIVER_CLANG_SUBCOMMAND_H_
|
|
#define CARBON_TOOLCHAIN_DRIVER_CLANG_SUBCOMMAND_H_
|
|
|
|
#include "common/command_line.h"
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include "toolchain/driver/driver_env.h"
|
|
#include "toolchain/driver/driver_subcommand.h"
|
|
|
|
namespace Carbon {
|
|
|
|
// Options for the clang subcommand, which is just a thin wrapper.
|
|
//
|
|
// See the implementation of `Build` for documentation on members.
|
|
struct ClangOptions {
|
|
auto Build(CommandLine::CommandBuilder& b) -> void;
|
|
|
|
bool build_runtimes_on_demand = false;
|
|
|
|
llvm::SmallVector<llvm::StringRef> args;
|
|
};
|
|
|
|
// Implements the clang subcommand of the driver.
|
|
class ClangSubcommand : public DriverSubcommand {
|
|
public:
|
|
explicit ClangSubcommand();
|
|
|
|
auto BuildOptions(CommandLine::CommandBuilder& b) -> void override {
|
|
options_.Build(b);
|
|
}
|
|
|
|
auto Run(DriverEnv& driver_env) -> DriverResult override;
|
|
|
|
private:
|
|
ClangOptions options_;
|
|
};
|
|
|
|
} // namespace Carbon
|
|
|
|
#endif // CARBON_TOOLCHAIN_DRIVER_CLANG_SUBCOMMAND_H_
|