blob: 6677843b2c5330b11981d8d64dbb9cf3608e6f20 [file] [log] [blame]
Puyan Lotfic382d032019-10-08 15:23:14 +00001//===--- InterfaceStubs.cpp - Base InterfaceStubs Implementations C++ ---===//
2//
3// 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
6//
7//===----------------------------------------------------------------------===//
8
9#include "InterfaceStubs.h"
10#include "CommonArgs.h"
11#include "clang/Driver/Compilation.h"
12
13namespace clang {
14namespace driver {
15namespace tools {
16namespace ifstool {
17void Merger::ConstructJob(Compilation &C, const JobAction &JA,
18 const InputInfo &Output, const InputInfoList &Inputs,
19 const llvm::opt::ArgList &Args,
20 const char *LinkingOutput) const {
21 std::string Merger = getToolChain().GetProgramPath(getShortName());
22 llvm::opt::ArgStringList CmdArgs;
23 CmdArgs.push_back("-action");
24 CmdArgs.push_back(Args.getLastArg(options::OPT_emit_merged_ifs)
25 ? "write-ifs"
26 : "write-bin");
27 CmdArgs.push_back("-o");
28 CmdArgs.push_back(Output.getFilename());
29 for (const auto &Input : Inputs)
30 CmdArgs.push_back(Input.getFilename());
31 C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Merger),
32 CmdArgs, Inputs));
33}
34} // namespace ifstool
35} // namespace tools
36} // namespace driver
37} // namespace clang