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