xref: /netbsd-src/external/apache2/llvm/dist/clang/lib/Driver/Action.cpp (revision e038c9c4676b0f19b1b7dd08a940c6ed64a6d5ae)
17330f729Sjoerg //===- Action.cpp - Abstract compilation steps ----------------------------===//
27330f729Sjoerg //
37330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
47330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information.
57330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
67330f729Sjoerg //
77330f729Sjoerg //===----------------------------------------------------------------------===//
87330f729Sjoerg 
97330f729Sjoerg #include "clang/Driver/Action.h"
107330f729Sjoerg #include "llvm/Support/ErrorHandling.h"
117330f729Sjoerg #include <cassert>
127330f729Sjoerg #include <string>
137330f729Sjoerg 
147330f729Sjoerg using namespace clang;
157330f729Sjoerg using namespace driver;
167330f729Sjoerg using namespace llvm::opt;
177330f729Sjoerg 
187330f729Sjoerg Action::~Action() = default;
197330f729Sjoerg 
getClassName(ActionClass AC)207330f729Sjoerg const char *Action::getClassName(ActionClass AC) {
217330f729Sjoerg   switch (AC) {
227330f729Sjoerg   case InputClass: return "input";
237330f729Sjoerg   case BindArchClass: return "bind-arch";
247330f729Sjoerg   case OffloadClass:
257330f729Sjoerg     return "offload";
267330f729Sjoerg   case PreprocessJobClass: return "preprocessor";
277330f729Sjoerg   case PrecompileJobClass: return "precompiler";
287330f729Sjoerg   case HeaderModulePrecompileJobClass: return "header-module-precompiler";
297330f729Sjoerg   case AnalyzeJobClass: return "analyzer";
307330f729Sjoerg   case MigrateJobClass: return "migrator";
317330f729Sjoerg   case CompileJobClass: return "compiler";
327330f729Sjoerg   case BackendJobClass: return "backend";
337330f729Sjoerg   case AssembleJobClass: return "assembler";
347330f729Sjoerg   case IfsMergeJobClass: return "interface-stub-merger";
357330f729Sjoerg   case LinkJobClass: return "linker";
367330f729Sjoerg   case LipoJobClass: return "lipo";
377330f729Sjoerg   case DsymutilJobClass: return "dsymutil";
387330f729Sjoerg   case VerifyDebugInfoJobClass: return "verify-debug-info";
397330f729Sjoerg   case VerifyPCHJobClass: return "verify-pch";
407330f729Sjoerg   case OffloadBundlingJobClass:
417330f729Sjoerg     return "clang-offload-bundler";
427330f729Sjoerg   case OffloadUnbundlingJobClass:
437330f729Sjoerg     return "clang-offload-unbundler";
447330f729Sjoerg   case OffloadWrapperJobClass:
457330f729Sjoerg     return "clang-offload-wrapper";
46*e038c9c4Sjoerg   case StaticLibJobClass:
47*e038c9c4Sjoerg     return "static-lib-linker";
487330f729Sjoerg   }
497330f729Sjoerg 
507330f729Sjoerg   llvm_unreachable("invalid class");
517330f729Sjoerg }
527330f729Sjoerg 
propagateDeviceOffloadInfo(OffloadKind OKind,const char * OArch)537330f729Sjoerg void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch) {
547330f729Sjoerg   // Offload action set its own kinds on their dependences.
557330f729Sjoerg   if (Kind == OffloadClass)
567330f729Sjoerg     return;
577330f729Sjoerg   // Unbundling actions use the host kinds.
587330f729Sjoerg   if (Kind == OffloadUnbundlingJobClass)
597330f729Sjoerg     return;
607330f729Sjoerg 
617330f729Sjoerg   assert((OffloadingDeviceKind == OKind || OffloadingDeviceKind == OFK_None) &&
627330f729Sjoerg          "Setting device kind to a different device??");
637330f729Sjoerg   assert(!ActiveOffloadKindMask && "Setting a device kind in a host action??");
647330f729Sjoerg   OffloadingDeviceKind = OKind;
657330f729Sjoerg   OffloadingArch = OArch;
667330f729Sjoerg 
677330f729Sjoerg   for (auto *A : Inputs)
687330f729Sjoerg     A->propagateDeviceOffloadInfo(OffloadingDeviceKind, OArch);
697330f729Sjoerg }
707330f729Sjoerg 
propagateHostOffloadInfo(unsigned OKinds,const char * OArch)717330f729Sjoerg void Action::propagateHostOffloadInfo(unsigned OKinds, const char *OArch) {
727330f729Sjoerg   // Offload action set its own kinds on their dependences.
737330f729Sjoerg   if (Kind == OffloadClass)
747330f729Sjoerg     return;
757330f729Sjoerg 
767330f729Sjoerg   assert(OffloadingDeviceKind == OFK_None &&
777330f729Sjoerg          "Setting a host kind in a device action.");
787330f729Sjoerg   ActiveOffloadKindMask |= OKinds;
797330f729Sjoerg   OffloadingArch = OArch;
807330f729Sjoerg 
817330f729Sjoerg   for (auto *A : Inputs)
827330f729Sjoerg     A->propagateHostOffloadInfo(ActiveOffloadKindMask, OArch);
837330f729Sjoerg }
847330f729Sjoerg 
propagateOffloadInfo(const Action * A)857330f729Sjoerg void Action::propagateOffloadInfo(const Action *A) {
867330f729Sjoerg   if (unsigned HK = A->getOffloadingHostActiveKinds())
877330f729Sjoerg     propagateHostOffloadInfo(HK, A->getOffloadingArch());
887330f729Sjoerg   else
897330f729Sjoerg     propagateDeviceOffloadInfo(A->getOffloadingDeviceKind(),
907330f729Sjoerg                                A->getOffloadingArch());
917330f729Sjoerg }
927330f729Sjoerg 
getOffloadingKindPrefix() const937330f729Sjoerg std::string Action::getOffloadingKindPrefix() const {
947330f729Sjoerg   switch (OffloadingDeviceKind) {
957330f729Sjoerg   case OFK_None:
967330f729Sjoerg     break;
977330f729Sjoerg   case OFK_Host:
987330f729Sjoerg     llvm_unreachable("Host kind is not an offloading device kind.");
997330f729Sjoerg     break;
1007330f729Sjoerg   case OFK_Cuda:
1017330f729Sjoerg     return "device-cuda";
1027330f729Sjoerg   case OFK_OpenMP:
1037330f729Sjoerg     return "device-openmp";
1047330f729Sjoerg   case OFK_HIP:
1057330f729Sjoerg     return "device-hip";
1067330f729Sjoerg 
1077330f729Sjoerg     // TODO: Add other programming models here.
1087330f729Sjoerg   }
1097330f729Sjoerg 
1107330f729Sjoerg   if (!ActiveOffloadKindMask)
1117330f729Sjoerg     return {};
1127330f729Sjoerg 
1137330f729Sjoerg   std::string Res("host");
1147330f729Sjoerg   assert(!((ActiveOffloadKindMask & OFK_Cuda) &&
1157330f729Sjoerg            (ActiveOffloadKindMask & OFK_HIP)) &&
1167330f729Sjoerg          "Cannot offload CUDA and HIP at the same time");
1177330f729Sjoerg   if (ActiveOffloadKindMask & OFK_Cuda)
1187330f729Sjoerg     Res += "-cuda";
1197330f729Sjoerg   if (ActiveOffloadKindMask & OFK_HIP)
1207330f729Sjoerg     Res += "-hip";
1217330f729Sjoerg   if (ActiveOffloadKindMask & OFK_OpenMP)
1227330f729Sjoerg     Res += "-openmp";
1237330f729Sjoerg 
1247330f729Sjoerg   // TODO: Add other programming models here.
1257330f729Sjoerg 
1267330f729Sjoerg   return Res;
1277330f729Sjoerg }
1287330f729Sjoerg 
1297330f729Sjoerg /// Return a string that can be used as prefix in order to generate unique files
1307330f729Sjoerg /// for each offloading kind.
1317330f729Sjoerg std::string
GetOffloadingFileNamePrefix(OffloadKind Kind,StringRef NormalizedTriple,bool CreatePrefixForHost)1327330f729Sjoerg Action::GetOffloadingFileNamePrefix(OffloadKind Kind,
1337330f729Sjoerg                                     StringRef NormalizedTriple,
1347330f729Sjoerg                                     bool CreatePrefixForHost) {
1357330f729Sjoerg   // Don't generate prefix for host actions unless required.
1367330f729Sjoerg   if (!CreatePrefixForHost && (Kind == OFK_None || Kind == OFK_Host))
1377330f729Sjoerg     return {};
1387330f729Sjoerg 
1397330f729Sjoerg   std::string Res("-");
1407330f729Sjoerg   Res += GetOffloadKindName(Kind);
1417330f729Sjoerg   Res += "-";
1427330f729Sjoerg   Res += NormalizedTriple;
1437330f729Sjoerg   return Res;
1447330f729Sjoerg }
1457330f729Sjoerg 
1467330f729Sjoerg /// Return a string with the offload kind name. If that is not defined, we
1477330f729Sjoerg /// assume 'host'.
GetOffloadKindName(OffloadKind Kind)1487330f729Sjoerg StringRef Action::GetOffloadKindName(OffloadKind Kind) {
1497330f729Sjoerg   switch (Kind) {
1507330f729Sjoerg   case OFK_None:
1517330f729Sjoerg   case OFK_Host:
1527330f729Sjoerg     return "host";
1537330f729Sjoerg   case OFK_Cuda:
1547330f729Sjoerg     return "cuda";
1557330f729Sjoerg   case OFK_OpenMP:
1567330f729Sjoerg     return "openmp";
1577330f729Sjoerg   case OFK_HIP:
1587330f729Sjoerg     return "hip";
1597330f729Sjoerg 
1607330f729Sjoerg     // TODO: Add other programming models here.
1617330f729Sjoerg   }
1627330f729Sjoerg 
1637330f729Sjoerg   llvm_unreachable("invalid offload kind");
1647330f729Sjoerg }
1657330f729Sjoerg 
anchor()1667330f729Sjoerg void InputAction::anchor() {}
1677330f729Sjoerg 
InputAction(const Arg & _Input,types::ID _Type,StringRef _Id)168*e038c9c4Sjoerg InputAction::InputAction(const Arg &_Input, types::ID _Type, StringRef _Id)
169*e038c9c4Sjoerg     : Action(InputClass, _Type), Input(_Input), Id(_Id.str()) {}
1707330f729Sjoerg 
anchor()1717330f729Sjoerg void BindArchAction::anchor() {}
1727330f729Sjoerg 
BindArchAction(Action * Input,StringRef ArchName)1737330f729Sjoerg BindArchAction::BindArchAction(Action *Input, StringRef ArchName)
1747330f729Sjoerg     : Action(BindArchClass, Input), ArchName(ArchName) {}
1757330f729Sjoerg 
anchor()1767330f729Sjoerg void OffloadAction::anchor() {}
1777330f729Sjoerg 
OffloadAction(const HostDependence & HDep)1787330f729Sjoerg OffloadAction::OffloadAction(const HostDependence &HDep)
1797330f729Sjoerg     : Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()) {
1807330f729Sjoerg   OffloadingArch = HDep.getBoundArch();
1817330f729Sjoerg   ActiveOffloadKindMask = HDep.getOffloadKinds();
1827330f729Sjoerg   HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(),
1837330f729Sjoerg                                              HDep.getBoundArch());
1847330f729Sjoerg }
1857330f729Sjoerg 
OffloadAction(const DeviceDependences & DDeps,types::ID Ty)1867330f729Sjoerg OffloadAction::OffloadAction(const DeviceDependences &DDeps, types::ID Ty)
1877330f729Sjoerg     : Action(OffloadClass, DDeps.getActions(), Ty),
1887330f729Sjoerg       DevToolChains(DDeps.getToolChains()) {
1897330f729Sjoerg   auto &OKinds = DDeps.getOffloadKinds();
1907330f729Sjoerg   auto &BArchs = DDeps.getBoundArchs();
1917330f729Sjoerg 
1927330f729Sjoerg   // If all inputs agree on the same kind, use it also for this action.
1937330f729Sjoerg   if (llvm::all_of(OKinds, [&](OffloadKind K) { return K == OKinds.front(); }))
1947330f729Sjoerg     OffloadingDeviceKind = OKinds.front();
1957330f729Sjoerg 
1967330f729Sjoerg   // If we have a single dependency, inherit the architecture from it.
1977330f729Sjoerg   if (OKinds.size() == 1)
1987330f729Sjoerg     OffloadingArch = BArchs.front();
1997330f729Sjoerg 
2007330f729Sjoerg   // Propagate info to the dependencies.
2017330f729Sjoerg   for (unsigned i = 0, e = getInputs().size(); i != e; ++i)
2027330f729Sjoerg     getInputs()[i]->propagateDeviceOffloadInfo(OKinds[i], BArchs[i]);
2037330f729Sjoerg }
2047330f729Sjoerg 
OffloadAction(const HostDependence & HDep,const DeviceDependences & DDeps)2057330f729Sjoerg OffloadAction::OffloadAction(const HostDependence &HDep,
2067330f729Sjoerg                              const DeviceDependences &DDeps)
2077330f729Sjoerg     : Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()),
2087330f729Sjoerg       DevToolChains(DDeps.getToolChains()) {
2097330f729Sjoerg   // We use the kinds of the host dependence for this action.
2107330f729Sjoerg   OffloadingArch = HDep.getBoundArch();
2117330f729Sjoerg   ActiveOffloadKindMask = HDep.getOffloadKinds();
2127330f729Sjoerg   HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(),
2137330f729Sjoerg                                              HDep.getBoundArch());
2147330f729Sjoerg 
2157330f729Sjoerg   // Add device inputs and propagate info to the device actions. Do work only if
2167330f729Sjoerg   // we have dependencies.
2177330f729Sjoerg   for (unsigned i = 0, e = DDeps.getActions().size(); i != e; ++i)
2187330f729Sjoerg     if (auto *A = DDeps.getActions()[i]) {
2197330f729Sjoerg       getInputs().push_back(A);
2207330f729Sjoerg       A->propagateDeviceOffloadInfo(DDeps.getOffloadKinds()[i],
2217330f729Sjoerg                                     DDeps.getBoundArchs()[i]);
2227330f729Sjoerg     }
2237330f729Sjoerg }
2247330f729Sjoerg 
doOnHostDependence(const OffloadActionWorkTy & Work) const2257330f729Sjoerg void OffloadAction::doOnHostDependence(const OffloadActionWorkTy &Work) const {
2267330f729Sjoerg   if (!HostTC)
2277330f729Sjoerg     return;
2287330f729Sjoerg   assert(!getInputs().empty() && "No dependencies for offload action??");
2297330f729Sjoerg   auto *A = getInputs().front();
2307330f729Sjoerg   Work(A, HostTC, A->getOffloadingArch());
2317330f729Sjoerg }
2327330f729Sjoerg 
doOnEachDeviceDependence(const OffloadActionWorkTy & Work) const2337330f729Sjoerg void OffloadAction::doOnEachDeviceDependence(
2347330f729Sjoerg     const OffloadActionWorkTy &Work) const {
2357330f729Sjoerg   auto I = getInputs().begin();
2367330f729Sjoerg   auto E = getInputs().end();
2377330f729Sjoerg   if (I == E)
2387330f729Sjoerg     return;
2397330f729Sjoerg 
2407330f729Sjoerg   // We expect to have the same number of input dependences and device tool
2417330f729Sjoerg   // chains, except if we also have a host dependence. In that case we have one
2427330f729Sjoerg   // more dependence than we have device tool chains.
2437330f729Sjoerg   assert(getInputs().size() == DevToolChains.size() + (HostTC ? 1 : 0) &&
2447330f729Sjoerg          "Sizes of action dependences and toolchains are not consistent!");
2457330f729Sjoerg 
2467330f729Sjoerg   // Skip host action
2477330f729Sjoerg   if (HostTC)
2487330f729Sjoerg     ++I;
2497330f729Sjoerg 
2507330f729Sjoerg   auto TI = DevToolChains.begin();
2517330f729Sjoerg   for (; I != E; ++I, ++TI)
2527330f729Sjoerg     Work(*I, *TI, (*I)->getOffloadingArch());
2537330f729Sjoerg }
2547330f729Sjoerg 
doOnEachDependence(const OffloadActionWorkTy & Work) const2557330f729Sjoerg void OffloadAction::doOnEachDependence(const OffloadActionWorkTy &Work) const {
2567330f729Sjoerg   doOnHostDependence(Work);
2577330f729Sjoerg   doOnEachDeviceDependence(Work);
2587330f729Sjoerg }
2597330f729Sjoerg 
doOnEachDependence(bool IsHostDependence,const OffloadActionWorkTy & Work) const2607330f729Sjoerg void OffloadAction::doOnEachDependence(bool IsHostDependence,
2617330f729Sjoerg                                        const OffloadActionWorkTy &Work) const {
2627330f729Sjoerg   if (IsHostDependence)
2637330f729Sjoerg     doOnHostDependence(Work);
2647330f729Sjoerg   else
2657330f729Sjoerg     doOnEachDeviceDependence(Work);
2667330f729Sjoerg }
2677330f729Sjoerg 
hasHostDependence() const2687330f729Sjoerg bool OffloadAction::hasHostDependence() const { return HostTC != nullptr; }
2697330f729Sjoerg 
getHostDependence() const2707330f729Sjoerg Action *OffloadAction::getHostDependence() const {
2717330f729Sjoerg   assert(hasHostDependence() && "Host dependence does not exist!");
2727330f729Sjoerg   assert(!getInputs().empty() && "No dependencies for offload action??");
2737330f729Sjoerg   return HostTC ? getInputs().front() : nullptr;
2747330f729Sjoerg }
2757330f729Sjoerg 
hasSingleDeviceDependence(bool DoNotConsiderHostActions) const2767330f729Sjoerg bool OffloadAction::hasSingleDeviceDependence(
2777330f729Sjoerg     bool DoNotConsiderHostActions) const {
2787330f729Sjoerg   if (DoNotConsiderHostActions)
2797330f729Sjoerg     return getInputs().size() == (HostTC ? 2 : 1);
2807330f729Sjoerg   return !HostTC && getInputs().size() == 1;
2817330f729Sjoerg }
2827330f729Sjoerg 
2837330f729Sjoerg Action *
getSingleDeviceDependence(bool DoNotConsiderHostActions) const2847330f729Sjoerg OffloadAction::getSingleDeviceDependence(bool DoNotConsiderHostActions) const {
2857330f729Sjoerg   assert(hasSingleDeviceDependence(DoNotConsiderHostActions) &&
2867330f729Sjoerg          "Single device dependence does not exist!");
2877330f729Sjoerg   // The previous assert ensures the number of entries in getInputs() is
2887330f729Sjoerg   // consistent with what we are doing here.
2897330f729Sjoerg   return HostTC ? getInputs()[1] : getInputs().front();
2907330f729Sjoerg }
2917330f729Sjoerg 
add(Action & A,const ToolChain & TC,const char * BoundArch,OffloadKind OKind)2927330f729Sjoerg void OffloadAction::DeviceDependences::add(Action &A, const ToolChain &TC,
2937330f729Sjoerg                                            const char *BoundArch,
2947330f729Sjoerg                                            OffloadKind OKind) {
2957330f729Sjoerg   DeviceActions.push_back(&A);
2967330f729Sjoerg   DeviceToolChains.push_back(&TC);
2977330f729Sjoerg   DeviceBoundArchs.push_back(BoundArch);
2987330f729Sjoerg   DeviceOffloadKinds.push_back(OKind);
2997330f729Sjoerg }
3007330f729Sjoerg 
HostDependence(Action & A,const ToolChain & TC,const char * BoundArch,const DeviceDependences & DDeps)3017330f729Sjoerg OffloadAction::HostDependence::HostDependence(Action &A, const ToolChain &TC,
3027330f729Sjoerg                                               const char *BoundArch,
3037330f729Sjoerg                                               const DeviceDependences &DDeps)
3047330f729Sjoerg     : HostAction(A), HostToolChain(TC), HostBoundArch(BoundArch) {
3057330f729Sjoerg   for (auto K : DDeps.getOffloadKinds())
3067330f729Sjoerg     HostOffloadKinds |= K;
3077330f729Sjoerg }
3087330f729Sjoerg 
anchor()3097330f729Sjoerg void JobAction::anchor() {}
3107330f729Sjoerg 
JobAction(ActionClass Kind,Action * Input,types::ID Type)3117330f729Sjoerg JobAction::JobAction(ActionClass Kind, Action *Input, types::ID Type)
3127330f729Sjoerg     : Action(Kind, Input, Type) {}
3137330f729Sjoerg 
JobAction(ActionClass Kind,const ActionList & Inputs,types::ID Type)3147330f729Sjoerg JobAction::JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type)
3157330f729Sjoerg     : Action(Kind, Inputs, Type) {}
3167330f729Sjoerg 
anchor()3177330f729Sjoerg void PreprocessJobAction::anchor() {}
3187330f729Sjoerg 
PreprocessJobAction(Action * Input,types::ID OutputType)3197330f729Sjoerg PreprocessJobAction::PreprocessJobAction(Action *Input, types::ID OutputType)
3207330f729Sjoerg     : JobAction(PreprocessJobClass, Input, OutputType) {}
3217330f729Sjoerg 
anchor()3227330f729Sjoerg void PrecompileJobAction::anchor() {}
3237330f729Sjoerg 
PrecompileJobAction(Action * Input,types::ID OutputType)3247330f729Sjoerg PrecompileJobAction::PrecompileJobAction(Action *Input, types::ID OutputType)
3257330f729Sjoerg     : JobAction(PrecompileJobClass, Input, OutputType) {}
3267330f729Sjoerg 
PrecompileJobAction(ActionClass Kind,Action * Input,types::ID OutputType)3277330f729Sjoerg PrecompileJobAction::PrecompileJobAction(ActionClass Kind, Action *Input,
3287330f729Sjoerg                                          types::ID OutputType)
3297330f729Sjoerg     : JobAction(Kind, Input, OutputType) {
3307330f729Sjoerg   assert(isa<PrecompileJobAction>((Action*)this) && "invalid action kind");
3317330f729Sjoerg }
3327330f729Sjoerg 
anchor()3337330f729Sjoerg void HeaderModulePrecompileJobAction::anchor() {}
3347330f729Sjoerg 
HeaderModulePrecompileJobAction(Action * Input,types::ID OutputType,const char * ModuleName)3357330f729Sjoerg HeaderModulePrecompileJobAction::HeaderModulePrecompileJobAction(
3367330f729Sjoerg     Action *Input, types::ID OutputType, const char *ModuleName)
3377330f729Sjoerg     : PrecompileJobAction(HeaderModulePrecompileJobClass, Input, OutputType),
3387330f729Sjoerg       ModuleName(ModuleName) {}
3397330f729Sjoerg 
anchor()3407330f729Sjoerg void AnalyzeJobAction::anchor() {}
3417330f729Sjoerg 
AnalyzeJobAction(Action * Input,types::ID OutputType)3427330f729Sjoerg AnalyzeJobAction::AnalyzeJobAction(Action *Input, types::ID OutputType)
3437330f729Sjoerg     : JobAction(AnalyzeJobClass, Input, OutputType) {}
3447330f729Sjoerg 
anchor()3457330f729Sjoerg void MigrateJobAction::anchor() {}
3467330f729Sjoerg 
MigrateJobAction(Action * Input,types::ID OutputType)3477330f729Sjoerg MigrateJobAction::MigrateJobAction(Action *Input, types::ID OutputType)
3487330f729Sjoerg     : JobAction(MigrateJobClass, Input, OutputType) {}
3497330f729Sjoerg 
anchor()3507330f729Sjoerg void CompileJobAction::anchor() {}
3517330f729Sjoerg 
CompileJobAction(Action * Input,types::ID OutputType)3527330f729Sjoerg CompileJobAction::CompileJobAction(Action *Input, types::ID OutputType)
3537330f729Sjoerg     : JobAction(CompileJobClass, Input, OutputType) {}
3547330f729Sjoerg 
anchor()3557330f729Sjoerg void BackendJobAction::anchor() {}
3567330f729Sjoerg 
BackendJobAction(Action * Input,types::ID OutputType)3577330f729Sjoerg BackendJobAction::BackendJobAction(Action *Input, types::ID OutputType)
3587330f729Sjoerg     : JobAction(BackendJobClass, Input, OutputType) {}
3597330f729Sjoerg 
anchor()3607330f729Sjoerg void AssembleJobAction::anchor() {}
3617330f729Sjoerg 
AssembleJobAction(Action * Input,types::ID OutputType)3627330f729Sjoerg AssembleJobAction::AssembleJobAction(Action *Input, types::ID OutputType)
3637330f729Sjoerg     : JobAction(AssembleJobClass, Input, OutputType) {}
3647330f729Sjoerg 
anchor()3657330f729Sjoerg void IfsMergeJobAction::anchor() {}
3667330f729Sjoerg 
IfsMergeJobAction(ActionList & Inputs,types::ID Type)3677330f729Sjoerg IfsMergeJobAction::IfsMergeJobAction(ActionList &Inputs, types::ID Type)
3687330f729Sjoerg     : JobAction(IfsMergeJobClass, Inputs, Type) {}
3697330f729Sjoerg 
anchor()3707330f729Sjoerg void LinkJobAction::anchor() {}
3717330f729Sjoerg 
LinkJobAction(ActionList & Inputs,types::ID Type)3727330f729Sjoerg LinkJobAction::LinkJobAction(ActionList &Inputs, types::ID Type)
3737330f729Sjoerg     : JobAction(LinkJobClass, Inputs, Type) {}
3747330f729Sjoerg 
anchor()3757330f729Sjoerg void LipoJobAction::anchor() {}
3767330f729Sjoerg 
LipoJobAction(ActionList & Inputs,types::ID Type)3777330f729Sjoerg LipoJobAction::LipoJobAction(ActionList &Inputs, types::ID Type)
3787330f729Sjoerg     : JobAction(LipoJobClass, Inputs, Type) {}
3797330f729Sjoerg 
anchor()3807330f729Sjoerg void DsymutilJobAction::anchor() {}
3817330f729Sjoerg 
DsymutilJobAction(ActionList & Inputs,types::ID Type)3827330f729Sjoerg DsymutilJobAction::DsymutilJobAction(ActionList &Inputs, types::ID Type)
3837330f729Sjoerg     : JobAction(DsymutilJobClass, Inputs, Type) {}
3847330f729Sjoerg 
anchor()3857330f729Sjoerg void VerifyJobAction::anchor() {}
3867330f729Sjoerg 
VerifyJobAction(ActionClass Kind,Action * Input,types::ID Type)3877330f729Sjoerg VerifyJobAction::VerifyJobAction(ActionClass Kind, Action *Input,
3887330f729Sjoerg                                  types::ID Type)
3897330f729Sjoerg     : JobAction(Kind, Input, Type) {
3907330f729Sjoerg   assert((Kind == VerifyDebugInfoJobClass || Kind == VerifyPCHJobClass) &&
3917330f729Sjoerg          "ActionClass is not a valid VerifyJobAction");
3927330f729Sjoerg }
3937330f729Sjoerg 
anchor()3947330f729Sjoerg void VerifyDebugInfoJobAction::anchor() {}
3957330f729Sjoerg 
VerifyDebugInfoJobAction(Action * Input,types::ID Type)3967330f729Sjoerg VerifyDebugInfoJobAction::VerifyDebugInfoJobAction(Action *Input,
3977330f729Sjoerg                                                    types::ID Type)
3987330f729Sjoerg     : VerifyJobAction(VerifyDebugInfoJobClass, Input, Type) {}
3997330f729Sjoerg 
anchor()4007330f729Sjoerg void VerifyPCHJobAction::anchor() {}
4017330f729Sjoerg 
VerifyPCHJobAction(Action * Input,types::ID Type)4027330f729Sjoerg VerifyPCHJobAction::VerifyPCHJobAction(Action *Input, types::ID Type)
4037330f729Sjoerg     : VerifyJobAction(VerifyPCHJobClass, Input, Type) {}
4047330f729Sjoerg 
anchor()4057330f729Sjoerg void OffloadBundlingJobAction::anchor() {}
4067330f729Sjoerg 
OffloadBundlingJobAction(ActionList & Inputs)4077330f729Sjoerg OffloadBundlingJobAction::OffloadBundlingJobAction(ActionList &Inputs)
4087330f729Sjoerg     : JobAction(OffloadBundlingJobClass, Inputs, Inputs.back()->getType()) {}
4097330f729Sjoerg 
anchor()4107330f729Sjoerg void OffloadUnbundlingJobAction::anchor() {}
4117330f729Sjoerg 
OffloadUnbundlingJobAction(Action * Input)4127330f729Sjoerg OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input)
4137330f729Sjoerg     : JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {}
4147330f729Sjoerg 
anchor()4157330f729Sjoerg void OffloadWrapperJobAction::anchor() {}
4167330f729Sjoerg 
OffloadWrapperJobAction(ActionList & Inputs,types::ID Type)4177330f729Sjoerg OffloadWrapperJobAction::OffloadWrapperJobAction(ActionList &Inputs,
4187330f729Sjoerg                                                  types::ID Type)
4197330f729Sjoerg   : JobAction(OffloadWrapperJobClass, Inputs, Type) {}
420*e038c9c4Sjoerg 
anchor()421*e038c9c4Sjoerg void StaticLibJobAction::anchor() {}
422*e038c9c4Sjoerg 
StaticLibJobAction(ActionList & Inputs,types::ID Type)423*e038c9c4Sjoerg StaticLibJobAction::StaticLibJobAction(ActionList &Inputs, types::ID Type)
424*e038c9c4Sjoerg     : JobAction(StaticLibJobClass, Inputs, Type) {}
425