[PATCH] D15936: Update code in buildCudaActions and BuildActions to latest idiom.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 8 11:07:53 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257190: Update code in buildCudaActions and BuildActions to latest idiom. (authored by jlebar).
Changed prior to commit:
http://reviews.llvm.org/D15936?vs=44158&id=44341#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15936
Files:
cfe/trunk/lib/Driver/Driver.cpp
Index: cfe/trunk/lib/Driver/Driver.cpp
===================================================================
--- cfe/trunk/lib/Driver/Driver.cpp
+++ cfe/trunk/lib/Driver/Driver.cpp
@@ -1298,11 +1298,11 @@
SmallVector<const char *, 4> GpuArchList;
llvm::StringSet<> GpuArchNames;
for (Arg *A : Args) {
- if (A->getOption().matches(options::OPT_cuda_gpu_arch_EQ)) {
- A->claim();
- if (GpuArchNames.insert(A->getValue()).second)
- GpuArchList.push_back(A->getValue());
- }
+ if (!A->getOption().matches(options::OPT_cuda_gpu_arch_EQ))
+ continue;
+ A->claim();
+ if (GpuArchNames.insert(A->getValue()).second)
+ GpuArchList.push_back(A->getValue());
}
// Default to sm_20 which is the lowest common denominator for supported GPUs.
@@ -1325,13 +1325,10 @@
"Failed to create actions for all devices");
// Check whether any of device actions stopped before they could generate PTX.
- bool PartialCompilation = false;
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
- if (CudaDeviceActions[I]->getKind() != Action::BackendJobClass) {
- PartialCompilation = true;
- break;
- }
- }
+ bool PartialCompilation =
+ llvm::any_of(CudaDeviceActions, [](const Action *a) {
+ return a->getKind() != Action::BackendJobClass;
+ });
// Figure out what to do with device actions -- pass them as inputs to the
// host action or run each of them independently.
@@ -1470,12 +1467,11 @@
continue;
}
- phases::ID CudaInjectionPhase = FinalPhase;
- for (const auto &Phase : PL)
- if (Phase <= FinalPhase && Phase == phases::Compile) {
- CudaInjectionPhase = Phase;
- break;
- }
+ phases::ID CudaInjectionPhase =
+ (phases::Compile < FinalPhase &&
+ llvm::find(PL, phases::Compile) != PL.end())
+ ? phases::Compile
+ : FinalPhase;
// Build the pipeline for this file.
std::unique_ptr<Action> Current(new InputAction(*InputArg, InputType));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15936.44341.patch
Type: text/x-patch
Size: 2040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160108/c246be9a/attachment.bin>
More information about the cfe-commits
mailing list