[clang] 4205f4a - [Cuda] Add the features using the last argument
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Fri May 13 15:05:12 PDT 2022
Author: Joseph Huber
Date: 2022-05-13T18:05:02-04:00
New Revision: 4205f4aba4aff74fa7681c3f991ef5fdaed48d35
URL: https://github.com/llvm/llvm-project/commit/4205f4aba4aff74fa7681c3f991ef5fdaed48d35
DIFF: https://github.com/llvm/llvm-project/commit/4205f4aba4aff74fa7681c3f991ef5fdaed48d35.diff
LOG: [Cuda] Add the features using the last argument
Summary:
We should use the last argument so this flag can be overridden properly.
Added:
Modified:
clang/lib/Driver/ToolChains/Cuda.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 9ce52cd34a3f..dcdcc9992e64 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -639,7 +639,7 @@ void NVPTX::getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
Optional<clang::CudaVersion> Version) {
if (Args.hasArg(options::OPT_cuda_feature_EQ)) {
StringRef PtxFeature =
- Args.getAllArgValues(options::OPT_cuda_feature_EQ).back();
+ Args.getLastArgValue(options::OPT_cuda_feature_EQ, "+ptx42");
Features.push_back(Args.MakeArgString(PtxFeature));
return;
} else if (!Version) {
More information about the cfe-commits
mailing list