Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 1 | //===- Action.cpp - Abstract compilation steps ----------------------------===// |
Daniel Dunbar | f479c12 | 2009-03-12 18:40:18 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "clang/Driver/Action.h" |
David Blaikie | 7900020 | 2011-09-23 05:57:42 +0000 | [diff] [blame] | 11 | #include "llvm/Support/ErrorHandling.h" |
Daniel Dunbar | f479c12 | 2009-03-12 18:40:18 +0000 | [diff] [blame] | 12 | #include <cassert> |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 13 | #include <string> |
| 14 | |
| 15 | using namespace clang; |
| 16 | using namespace driver; |
Reid Kleckner | 898229a | 2013-06-14 17:17:23 +0000 | [diff] [blame] | 17 | using namespace llvm::opt; |
Daniel Dunbar | f479c12 | 2009-03-12 18:40:18 +0000 | [diff] [blame] | 18 | |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 19 | Action::~Action() = default; |
Daniel Dunbar | 80665fb | 2009-03-13 12:17:08 +0000 | [diff] [blame] | 20 | |
| 21 | const char *Action::getClassName(ActionClass AC) { |
| 22 | switch (AC) { |
| 23 | case InputClass: return "input"; |
| 24 | case BindArchClass: return "bind-arch"; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 25 | case OffloadClass: |
| 26 | return "offload"; |
Daniel Dunbar | 7326ad5 | 2009-03-13 17:52:07 +0000 | [diff] [blame] | 27 | case PreprocessJobClass: return "preprocessor"; |
| 28 | case PrecompileJobClass: return "precompiler"; |
| 29 | case AnalyzeJobClass: return "analyzer"; |
Ted Kremenek | f7639e1 | 2012-03-06 20:06:33 +0000 | [diff] [blame] | 30 | case MigrateJobClass: return "migrator"; |
Daniel Dunbar | 7326ad5 | 2009-03-13 17:52:07 +0000 | [diff] [blame] | 31 | case CompileJobClass: return "compiler"; |
Bob Wilson | 23a55f1 | 2014-12-21 07:00:00 +0000 | [diff] [blame] | 32 | case BackendJobClass: return "backend"; |
Daniel Dunbar | 7326ad5 | 2009-03-13 17:52:07 +0000 | [diff] [blame] | 33 | case AssembleJobClass: return "assembler"; |
| 34 | case LinkJobClass: return "linker"; |
Daniel Dunbar | 80665fb | 2009-03-13 12:17:08 +0000 | [diff] [blame] | 35 | case LipoJobClass: return "lipo"; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 36 | case DsymutilJobClass: return "dsymutil"; |
Ben Langmuir | 9b9a8d3 | 2014-02-06 18:53:25 +0000 | [diff] [blame] | 37 | case VerifyDebugInfoJobClass: return "verify-debug-info"; |
| 38 | case VerifyPCHJobClass: return "verify-pch"; |
Samuel Antao | 69d6f31 | 2016-10-27 17:50:43 +0000 | [diff] [blame] | 39 | case OffloadBundlingJobClass: |
| 40 | return "clang-offload-bundler"; |
Samuel Antao | fab4f37 | 2016-10-27 18:00:51 +0000 | [diff] [blame] | 41 | case OffloadUnbundlingJobClass: |
| 42 | return "clang-offload-unbundler"; |
Daniel Dunbar | 80665fb | 2009-03-13 12:17:08 +0000 | [diff] [blame] | 43 | } |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 44 | |
David Blaikie | 83d382b | 2011-09-23 05:06:16 +0000 | [diff] [blame] | 45 | llvm_unreachable("invalid class"); |
Daniel Dunbar | 80665fb | 2009-03-13 12:17:08 +0000 | [diff] [blame] | 46 | } |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 47 | |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 48 | void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch) { |
| 49 | // Offload action set its own kinds on their dependences. |
| 50 | if (Kind == OffloadClass) |
| 51 | return; |
Samuel Antao | fab4f37 | 2016-10-27 18:00:51 +0000 | [diff] [blame] | 52 | // Unbundling actions use the host kinds. |
| 53 | if (Kind == OffloadUnbundlingJobClass) |
| 54 | return; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 55 | |
| 56 | assert((OffloadingDeviceKind == OKind || OffloadingDeviceKind == OFK_None) && |
| 57 | "Setting device kind to a different device??"); |
| 58 | assert(!ActiveOffloadKindMask && "Setting a device kind in a host action??"); |
| 59 | OffloadingDeviceKind = OKind; |
| 60 | OffloadingArch = OArch; |
| 61 | |
| 62 | for (auto *A : Inputs) |
| 63 | A->propagateDeviceOffloadInfo(OffloadingDeviceKind, OArch); |
| 64 | } |
| 65 | |
| 66 | void Action::propagateHostOffloadInfo(unsigned OKinds, const char *OArch) { |
| 67 | // Offload action set its own kinds on their dependences. |
| 68 | if (Kind == OffloadClass) |
| 69 | return; |
| 70 | |
| 71 | assert(OffloadingDeviceKind == OFK_None && |
| 72 | "Setting a host kind in a device action."); |
| 73 | ActiveOffloadKindMask |= OKinds; |
| 74 | OffloadingArch = OArch; |
| 75 | |
| 76 | for (auto *A : Inputs) |
| 77 | A->propagateHostOffloadInfo(ActiveOffloadKindMask, OArch); |
| 78 | } |
| 79 | |
| 80 | void Action::propagateOffloadInfo(const Action *A) { |
| 81 | if (unsigned HK = A->getOffloadingHostActiveKinds()) |
| 82 | propagateHostOffloadInfo(HK, A->getOffloadingArch()); |
| 83 | else |
| 84 | propagateDeviceOffloadInfo(A->getOffloadingDeviceKind(), |
| 85 | A->getOffloadingArch()); |
| 86 | } |
| 87 | |
| 88 | std::string Action::getOffloadingKindPrefix() const { |
| 89 | switch (OffloadingDeviceKind) { |
| 90 | case OFK_None: |
| 91 | break; |
| 92 | case OFK_Host: |
| 93 | llvm_unreachable("Host kind is not an offloading device kind."); |
| 94 | break; |
| 95 | case OFK_Cuda: |
| 96 | return "device-cuda"; |
Samuel Antao | 39f9da2 | 2016-10-27 16:38:05 +0000 | [diff] [blame] | 97 | case OFK_OpenMP: |
| 98 | return "device-openmp"; |
Yaxun Liu | 398612b | 2018-05-08 21:02:12 +0000 | [diff] [blame] | 99 | case OFK_HIP: |
| 100 | return "device-hip"; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 101 | |
| 102 | // TODO: Add other programming models here. |
| 103 | } |
| 104 | |
| 105 | if (!ActiveOffloadKindMask) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 106 | return {}; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 107 | |
| 108 | std::string Res("host"); |
Yaxun Liu | 398612b | 2018-05-08 21:02:12 +0000 | [diff] [blame] | 109 | assert(!((ActiveOffloadKindMask & OFK_Cuda) && |
| 110 | (ActiveOffloadKindMask & OFK_HIP)) && |
| 111 | "Cannot offload CUDA and HIP at the same time"); |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 112 | if (ActiveOffloadKindMask & OFK_Cuda) |
| 113 | Res += "-cuda"; |
Yaxun Liu | 398612b | 2018-05-08 21:02:12 +0000 | [diff] [blame] | 114 | if (ActiveOffloadKindMask & OFK_HIP) |
| 115 | Res += "-hip"; |
Samuel Antao | 39f9da2 | 2016-10-27 16:38:05 +0000 | [diff] [blame] | 116 | if (ActiveOffloadKindMask & OFK_OpenMP) |
| 117 | Res += "-openmp"; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 118 | |
| 119 | // TODO: Add other programming models here. |
| 120 | |
| 121 | return Res; |
| 122 | } |
| 123 | |
Samuel Antao | 3b7e38b | 2016-10-27 18:14:55 +0000 | [diff] [blame] | 124 | /// Return a string that can be used as prefix in order to generate unique files |
| 125 | /// for each offloading kind. |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 126 | std::string |
Samuel Antao | 3b7e38b | 2016-10-27 18:14:55 +0000 | [diff] [blame] | 127 | Action::GetOffloadingFileNamePrefix(OffloadKind Kind, |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 128 | StringRef NormalizedTriple, |
Samuel Antao | 3b7e38b | 2016-10-27 18:14:55 +0000 | [diff] [blame] | 129 | bool CreatePrefixForHost) { |
| 130 | // Don't generate prefix for host actions unless required. |
| 131 | if (!CreatePrefixForHost && (Kind == OFK_None || Kind == OFK_Host)) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 132 | return {}; |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 133 | |
| 134 | std::string Res("-"); |
Samuel Antao | 3b7e38b | 2016-10-27 18:14:55 +0000 | [diff] [blame] | 135 | Res += GetOffloadKindName(Kind); |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 136 | Res += "-"; |
| 137 | Res += NormalizedTriple; |
| 138 | return Res; |
| 139 | } |
| 140 | |
Samuel Antao | 7cab8f1 | 2016-10-27 18:04:42 +0000 | [diff] [blame] | 141 | /// Return a string with the offload kind name. If that is not defined, we |
| 142 | /// assume 'host'. |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 143 | StringRef Action::GetOffloadKindName(OffloadKind Kind) { |
Samuel Antao | 7cab8f1 | 2016-10-27 18:04:42 +0000 | [diff] [blame] | 144 | switch (Kind) { |
| 145 | case OFK_None: |
| 146 | case OFK_Host: |
| 147 | return "host"; |
| 148 | case OFK_Cuda: |
| 149 | return "cuda"; |
| 150 | case OFK_OpenMP: |
| 151 | return "openmp"; |
Yaxun Liu | 398612b | 2018-05-08 21:02:12 +0000 | [diff] [blame] | 152 | case OFK_HIP: |
| 153 | return "hip"; |
Samuel Antao | 7cab8f1 | 2016-10-27 18:04:42 +0000 | [diff] [blame] | 154 | |
| 155 | // TODO: Add other programming models here. |
| 156 | } |
Simon Pilgrim | 3315a6a | 2016-10-28 10:09:35 +0000 | [diff] [blame] | 157 | |
| 158 | llvm_unreachable("invalid offload kind"); |
Samuel Antao | 7cab8f1 | 2016-10-27 18:04:42 +0000 | [diff] [blame] | 159 | } |
| 160 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 161 | void InputAction::anchor() {} |
| 162 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 163 | InputAction::InputAction(const Arg &_Input, types::ID _Type) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 164 | : Action(InputClass, _Type), Input(_Input) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 165 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 166 | void BindArchAction::anchor() {} |
| 167 | |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 168 | BindArchAction::BindArchAction(Action *Input, StringRef ArchName) |
Mehdi Amini | 087f1fb | 2016-10-07 22:03:03 +0000 | [diff] [blame] | 169 | : Action(BindArchClass, Input), ArchName(ArchName) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 170 | |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 171 | void OffloadAction::anchor() {} |
Artem Belevich | 0ff05cd | 2015-07-13 23:27:56 +0000 | [diff] [blame] | 172 | |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 173 | OffloadAction::OffloadAction(const HostDependence &HDep) |
| 174 | : Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()) { |
| 175 | OffloadingArch = HDep.getBoundArch(); |
| 176 | ActiveOffloadKindMask = HDep.getOffloadKinds(); |
| 177 | HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(), |
| 178 | HDep.getBoundArch()); |
Eric Christopher | 2a7248f | 2016-07-16 00:58:34 +0000 | [diff] [blame] | 179 | } |
Artem Belevich | 0ff05cd | 2015-07-13 23:27:56 +0000 | [diff] [blame] | 180 | |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 181 | OffloadAction::OffloadAction(const DeviceDependences &DDeps, types::ID Ty) |
| 182 | : Action(OffloadClass, DDeps.getActions(), Ty), |
| 183 | DevToolChains(DDeps.getToolChains()) { |
| 184 | auto &OKinds = DDeps.getOffloadKinds(); |
| 185 | auto &BArchs = DDeps.getBoundArchs(); |
Artem Belevich | 0ff05cd | 2015-07-13 23:27:56 +0000 | [diff] [blame] | 186 | |
Samuel Antao | d06239d | 2016-07-15 23:13:27 +0000 | [diff] [blame] | 187 | // If all inputs agree on the same kind, use it also for this action. |
| 188 | if (llvm::all_of(OKinds, [&](OffloadKind K) { return K == OKinds.front(); })) |
| 189 | OffloadingDeviceKind = OKinds.front(); |
| 190 | |
| 191 | // If we have a single dependency, inherit the architecture from it. |
| 192 | if (OKinds.size() == 1) |
| 193 | OffloadingArch = BArchs.front(); |
| 194 | |
| 195 | // Propagate info to the dependencies. |
| 196 | for (unsigned i = 0, e = getInputs().size(); i != e; ++i) |
| 197 | getInputs()[i]->propagateDeviceOffloadInfo(OKinds[i], BArchs[i]); |
| 198 | } |
| 199 | |
| 200 | OffloadAction::OffloadAction(const HostDependence &HDep, |
| 201 | const DeviceDependences &DDeps) |
| 202 | : Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()), |
| 203 | DevToolChains(DDeps.getToolChains()) { |
| 204 | // We use the kinds of the host dependence for this action. |
| 205 | OffloadingArch = HDep.getBoundArch(); |
| 206 | ActiveOffloadKindMask = HDep.getOffloadKinds(); |
| 207 | HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(), |
| 208 | HDep.getBoundArch()); |
| 209 | |
| 210 | // Add device inputs and propagate info to the device actions. Do work only if |
| 211 | // we have dependencies. |
| 212 | for (unsigned i = 0, e = DDeps.getActions().size(); i != e; ++i) |
| 213 | if (auto *A = DDeps.getActions()[i]) { |
| 214 | getInputs().push_back(A); |
| 215 | A->propagateDeviceOffloadInfo(DDeps.getOffloadKinds()[i], |
| 216 | DDeps.getBoundArchs()[i]); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | void OffloadAction::doOnHostDependence(const OffloadActionWorkTy &Work) const { |
| 221 | if (!HostTC) |
| 222 | return; |
| 223 | assert(!getInputs().empty() && "No dependencies for offload action??"); |
| 224 | auto *A = getInputs().front(); |
| 225 | Work(A, HostTC, A->getOffloadingArch()); |
| 226 | } |
| 227 | |
| 228 | void OffloadAction::doOnEachDeviceDependence( |
| 229 | const OffloadActionWorkTy &Work) const { |
| 230 | auto I = getInputs().begin(); |
| 231 | auto E = getInputs().end(); |
| 232 | if (I == E) |
| 233 | return; |
| 234 | |
| 235 | // We expect to have the same number of input dependences and device tool |
| 236 | // chains, except if we also have a host dependence. In that case we have one |
| 237 | // more dependence than we have device tool chains. |
| 238 | assert(getInputs().size() == DevToolChains.size() + (HostTC ? 1 : 0) && |
| 239 | "Sizes of action dependences and toolchains are not consistent!"); |
| 240 | |
| 241 | // Skip host action |
| 242 | if (HostTC) |
| 243 | ++I; |
| 244 | |
| 245 | auto TI = DevToolChains.begin(); |
| 246 | for (; I != E; ++I, ++TI) |
| 247 | Work(*I, *TI, (*I)->getOffloadingArch()); |
| 248 | } |
| 249 | |
| 250 | void OffloadAction::doOnEachDependence(const OffloadActionWorkTy &Work) const { |
| 251 | doOnHostDependence(Work); |
| 252 | doOnEachDeviceDependence(Work); |
| 253 | } |
| 254 | |
| 255 | void OffloadAction::doOnEachDependence(bool IsHostDependence, |
| 256 | const OffloadActionWorkTy &Work) const { |
| 257 | if (IsHostDependence) |
| 258 | doOnHostDependence(Work); |
| 259 | else |
| 260 | doOnEachDeviceDependence(Work); |
| 261 | } |
| 262 | |
| 263 | bool OffloadAction::hasHostDependence() const { return HostTC != nullptr; } |
| 264 | |
| 265 | Action *OffloadAction::getHostDependence() const { |
| 266 | assert(hasHostDependence() && "Host dependence does not exist!"); |
| 267 | assert(!getInputs().empty() && "No dependencies for offload action??"); |
| 268 | return HostTC ? getInputs().front() : nullptr; |
| 269 | } |
| 270 | |
| 271 | bool OffloadAction::hasSingleDeviceDependence( |
| 272 | bool DoNotConsiderHostActions) const { |
| 273 | if (DoNotConsiderHostActions) |
| 274 | return getInputs().size() == (HostTC ? 2 : 1); |
| 275 | return !HostTC && getInputs().size() == 1; |
| 276 | } |
| 277 | |
| 278 | Action * |
| 279 | OffloadAction::getSingleDeviceDependence(bool DoNotConsiderHostActions) const { |
| 280 | assert(hasSingleDeviceDependence(DoNotConsiderHostActions) && |
| 281 | "Single device dependence does not exist!"); |
| 282 | // The previous assert ensures the number of entries in getInputs() is |
| 283 | // consistent with what we are doing here. |
| 284 | return HostTC ? getInputs()[1] : getInputs().front(); |
| 285 | } |
| 286 | |
| 287 | void OffloadAction::DeviceDependences::add(Action &A, const ToolChain &TC, |
| 288 | const char *BoundArch, |
| 289 | OffloadKind OKind) { |
| 290 | DeviceActions.push_back(&A); |
| 291 | DeviceToolChains.push_back(&TC); |
| 292 | DeviceBoundArchs.push_back(BoundArch); |
| 293 | DeviceOffloadKinds.push_back(OKind); |
| 294 | } |
| 295 | |
| 296 | OffloadAction::HostDependence::HostDependence(Action &A, const ToolChain &TC, |
| 297 | const char *BoundArch, |
| 298 | const DeviceDependences &DDeps) |
| 299 | : HostAction(A), HostToolChain(TC), HostBoundArch(BoundArch) { |
| 300 | for (auto K : DDeps.getOffloadKinds()) |
| 301 | HostOffloadKinds |= K; |
| 302 | } |
Artem Belevich | 0ff05cd | 2015-07-13 23:27:56 +0000 | [diff] [blame] | 303 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 304 | void JobAction::anchor() {} |
| 305 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 306 | JobAction::JobAction(ActionClass Kind, Action *Input, types::ID Type) |
| 307 | : Action(Kind, Input, Type) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 308 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 309 | JobAction::JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 310 | : Action(Kind, Inputs, Type) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 311 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 312 | void PreprocessJobAction::anchor() {} |
| 313 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 314 | PreprocessJobAction::PreprocessJobAction(Action *Input, types::ID OutputType) |
| 315 | : JobAction(PreprocessJobClass, Input, OutputType) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 316 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 317 | void PrecompileJobAction::anchor() {} |
| 318 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 319 | PrecompileJobAction::PrecompileJobAction(Action *Input, types::ID OutputType) |
| 320 | : JobAction(PrecompileJobClass, Input, OutputType) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 321 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 322 | void AnalyzeJobAction::anchor() {} |
| 323 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 324 | AnalyzeJobAction::AnalyzeJobAction(Action *Input, types::ID OutputType) |
| 325 | : JobAction(AnalyzeJobClass, Input, OutputType) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 326 | |
Ted Kremenek | f7639e1 | 2012-03-06 20:06:33 +0000 | [diff] [blame] | 327 | void MigrateJobAction::anchor() {} |
| 328 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 329 | MigrateJobAction::MigrateJobAction(Action *Input, types::ID OutputType) |
| 330 | : JobAction(MigrateJobClass, Input, OutputType) {} |
Ted Kremenek | f7639e1 | 2012-03-06 20:06:33 +0000 | [diff] [blame] | 331 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 332 | void CompileJobAction::anchor() {} |
| 333 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 334 | CompileJobAction::CompileJobAction(Action *Input, types::ID OutputType) |
| 335 | : JobAction(CompileJobClass, Input, OutputType) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 336 | |
Bob Wilson | 23a55f1 | 2014-12-21 07:00:00 +0000 | [diff] [blame] | 337 | void BackendJobAction::anchor() {} |
| 338 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 339 | BackendJobAction::BackendJobAction(Action *Input, types::ID OutputType) |
| 340 | : JobAction(BackendJobClass, Input, OutputType) {} |
Bob Wilson | 23a55f1 | 2014-12-21 07:00:00 +0000 | [diff] [blame] | 341 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 342 | void AssembleJobAction::anchor() {} |
| 343 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 344 | AssembleJobAction::AssembleJobAction(Action *Input, types::ID OutputType) |
| 345 | : JobAction(AssembleJobClass, Input, OutputType) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 346 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 347 | void LinkJobAction::anchor() {} |
| 348 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 349 | LinkJobAction::LinkJobAction(ActionList &Inputs, types::ID Type) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 350 | : JobAction(LinkJobClass, Inputs, Type) {} |
Daniel Dunbar | 3f261ff | 2009-03-13 23:08:03 +0000 | [diff] [blame] | 351 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 352 | void LipoJobAction::anchor() {} |
| 353 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 354 | LipoJobAction::LipoJobAction(ActionList &Inputs, types::ID Type) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 355 | : JobAction(LipoJobClass, Inputs, Type) {} |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 356 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 357 | void DsymutilJobAction::anchor() {} |
| 358 | |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 359 | DsymutilJobAction::DsymutilJobAction(ActionList &Inputs, types::ID Type) |
Eugene Zelenko | 5e4511c | 2018-03-20 21:08:59 +0000 | [diff] [blame] | 360 | : JobAction(DsymutilJobClass, Inputs, Type) {} |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 361 | |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 362 | void VerifyJobAction::anchor() {} |
| 363 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 364 | VerifyJobAction::VerifyJobAction(ActionClass Kind, Action *Input, |
| 365 | types::ID Type) |
| 366 | : JobAction(Kind, Input, Type) { |
Ben Langmuir | 9b9a8d3 | 2014-02-06 18:53:25 +0000 | [diff] [blame] | 367 | assert((Kind == VerifyDebugInfoJobClass || Kind == VerifyPCHJobClass) && |
| 368 | "ActionClass is not a valid VerifyJobAction"); |
| 369 | } |
| 370 | |
Ben Langmuir | 9b9a8d3 | 2014-02-06 18:53:25 +0000 | [diff] [blame] | 371 | void VerifyDebugInfoJobAction::anchor() {} |
| 372 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 373 | VerifyDebugInfoJobAction::VerifyDebugInfoJobAction(Action *Input, |
| 374 | types::ID Type) |
| 375 | : VerifyJobAction(VerifyDebugInfoJobClass, Input, Type) {} |
Ben Langmuir | 9b9a8d3 | 2014-02-06 18:53:25 +0000 | [diff] [blame] | 376 | |
| 377 | void VerifyPCHJobAction::anchor() {} |
| 378 | |
Justin Lebar | 4109461 | 2016-01-11 23:07:27 +0000 | [diff] [blame] | 379 | VerifyPCHJobAction::VerifyPCHJobAction(Action *Input, types::ID Type) |
| 380 | : VerifyJobAction(VerifyPCHJobClass, Input, Type) {} |
Samuel Antao | 69d6f31 | 2016-10-27 17:50:43 +0000 | [diff] [blame] | 381 | |
| 382 | void OffloadBundlingJobAction::anchor() {} |
| 383 | |
| 384 | OffloadBundlingJobAction::OffloadBundlingJobAction(ActionList &Inputs) |
Yaxun Liu | ac8ccd5 | 2018-08-28 21:09:09 +0000 | [diff] [blame] | 385 | : JobAction(OffloadBundlingJobClass, Inputs, Inputs.back()->getType()) {} |
Samuel Antao | fab4f37 | 2016-10-27 18:00:51 +0000 | [diff] [blame] | 386 | |
| 387 | void OffloadUnbundlingJobAction::anchor() {} |
| 388 | |
| 389 | OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input) |
| 390 | : JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {} |