xref: /freebsd/contrib/llvm-project/clang/lib/Driver/Tool.cpp (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric //===--- Tool.cpp - Compilation Tools -------------------------------------===//
2*0b57cec5SDimitry Andric //
3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric //
7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric 
9*0b57cec5SDimitry Andric #include "clang/Driver/Tool.h"
10*0b57cec5SDimitry Andric #include "InputInfo.h"
11*0b57cec5SDimitry Andric 
12*0b57cec5SDimitry Andric using namespace clang::driver;
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric Tool::Tool(const char *_Name, const char *_ShortName, const ToolChain &TC,
15*0b57cec5SDimitry Andric            ResponseFileSupport _ResponseSupport,
16*0b57cec5SDimitry Andric            llvm::sys::WindowsEncodingMethod _ResponseEncoding,
17*0b57cec5SDimitry Andric            const char *_ResponseFlag)
18*0b57cec5SDimitry Andric     : Name(_Name), ShortName(_ShortName), TheToolChain(TC),
19*0b57cec5SDimitry Andric       ResponseSupport(_ResponseSupport), ResponseEncoding(_ResponseEncoding),
20*0b57cec5SDimitry Andric       ResponseFlag(_ResponseFlag) {}
21*0b57cec5SDimitry Andric 
22*0b57cec5SDimitry Andric Tool::~Tool() {
23*0b57cec5SDimitry Andric }
24*0b57cec5SDimitry Andric 
25*0b57cec5SDimitry Andric void Tool::ConstructJobMultipleOutputs(Compilation &C, const JobAction &JA,
26*0b57cec5SDimitry Andric                                        const InputInfoList &Outputs,
27*0b57cec5SDimitry Andric                                        const InputInfoList &Inputs,
28*0b57cec5SDimitry Andric                                        const llvm::opt::ArgList &TCArgs,
29*0b57cec5SDimitry Andric                                        const char *LinkingOutput) const {
30*0b57cec5SDimitry Andric   assert(Outputs.size() == 1 && "Expected only one output by default!");
31*0b57cec5SDimitry Andric   ConstructJob(C, JA, Outputs.front(), Inputs, TCArgs, LinkingOutput);
32*0b57cec5SDimitry Andric }
33