Puyan Lotfi | c382d03 | 2019-10-08 15:23:14 +0000 | [diff] [blame] | 1 | //===--- 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 | |
| 13 | namespace clang { |
| 14 | namespace driver { |
| 15 | namespace tools { |
| 16 | namespace ifstool { |
| 17 | void 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 |