blob: 9ff6e863a1242de4840e6c6c2478a8fac7825b2a [file] [log] [blame]
Nick Lewycky6da90772010-12-31 17:31:54 +00001//===--- Tool.cpp - Compilation Tools -------------------------------------===//
Daniel Dunbar9e2136d2009-03-16 05:25:36 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Daniel Dunbar9e2136d2009-03-16 05:25:36 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "clang/Driver/Tool.h"
Samuel Antao3b7e38b2016-10-27 18:14:55 +000010#include "InputInfo.h"
Daniel Dunbar9e2136d2009-03-16 05:25:36 +000011
12using namespace clang::driver;
13
Reid Kleckner0290c9c2014-09-15 17:45:39 +000014Tool::Tool(const char *_Name, const char *_ShortName, const ToolChain &TC,
15 ResponseFileSupport _ResponseSupport,
16 llvm::sys::WindowsEncodingMethod _ResponseEncoding,
17 const char *_ResponseFlag)
18 : Name(_Name), ShortName(_ShortName), TheToolChain(TC),
19 ResponseSupport(_ResponseSupport), ResponseEncoding(_ResponseEncoding),
20 ResponseFlag(_ResponseFlag) {}
Daniel Dunbar04cb0292009-03-17 22:07:31 +000021
Angel Garcia Gomez637d1e62015-10-20 13:23:58 +000022Tool::~Tool() {
23}
Samuel Antao3b7e38b2016-10-27 18:14:55 +000024
Samuel Antao7108bf32016-11-03 15:41:50 +000025void Tool::ConstructJobMultipleOutputs(Compilation &C, const JobAction &JA,
26 const InputInfoList &Outputs,
27 const InputInfoList &Inputs,
28 const llvm::opt::ArgList &TCArgs,
29 const char *LinkingOutput) const {
Samuel Antao3b7e38b2016-10-27 18:14:55 +000030 assert(Outputs.size() == 1 && "Expected only one output by default!");
31 ConstructJob(C, JA, Outputs.front(), Inputs, TCArgs, LinkingOutput);
Samuel Antao7108bf32016-11-03 15:41:50 +000032}