mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 22:02:42 +01:00
Previously this was kept in `//toolchain/install` so it would be near to the code that actually defines the installation layout. However, that creates somewhat unfortunate dependency cycles between `//toolchain/install` and other directories. Exacerbating this, a subsequent PR is likely to add dependencies on it from `//toolchain/base` itself that suggests that is the correct layering. This PR just moves the code mechanically with as few other edits as possible.
37 lines
1.2 KiB
C++
37 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_LLD_RUNNER_H_
|
|
#define CARBON_TOOLCHAIN_DRIVER_LLD_RUNNER_H_
|
|
|
|
#include "common/ostream.h"
|
|
#include "lld/Common/Driver.h"
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include "toolchain/base/install_paths.h"
|
|
#include "toolchain/driver/tool_runner_base.h"
|
|
|
|
namespace Carbon {
|
|
|
|
// Runs LLD in a manner similar to invoking it with the provided arguments.
|
|
class LldRunner : ToolRunnerBase {
|
|
public:
|
|
using ToolRunnerBase::ToolRunnerBase;
|
|
|
|
// Run LLD as a GNU-style linker with the provided arguments.
|
|
auto ElfLink(llvm::ArrayRef<llvm::StringRef> args) -> bool;
|
|
|
|
// Run LLD as a Darwin-style linker with the provided arguments.
|
|
auto MachOLink(llvm::ArrayRef<llvm::StringRef> args) -> bool;
|
|
|
|
private:
|
|
auto LinkHelper(llvm::StringLiteral label,
|
|
llvm::ArrayRef<llvm::StringRef> args, const std::string& path,
|
|
lld::DriverDef driver_def) -> bool;
|
|
};
|
|
|
|
} // namespace Carbon
|
|
|
|
#endif // CARBON_TOOLCHAIN_DRIVER_LLD_RUNNER_H_
|