Skip to content

Commit d912232

Browse files
committed
[CUDA][FIX] Fix name conflict in getNVPTXTargetFeatures
Summary: There was a naming conflict in the getNVPTXTargetFeatures function that prevented some compilers from correctly disambiguating between the enumeration and variable of the same name. Rename the variable to avoid this.
1 parent f74413d commit d912232

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,17 +633,17 @@ void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA,
633633
void NVPTX::getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
634634
const llvm::opt::ArgList &Args,
635635
std::vector<StringRef> &Features,
636-
Optional<clang::CudaVersion> CudaVersion) {
637-
if (!CudaVersion) {
636+
Optional<clang::CudaVersion> Version) {
637+
if (!Version) {
638638
CudaInstallationDetector CudaInstallation(D, Triple, Args);
639-
CudaVersion = CudaInstallation.version();
639+
Version = CudaInstallation.version();
640640
}
641641

642642
// New CUDA versions often introduce new instructions that are only supported
643643
// by new PTX version, so we need to raise PTX level to enable them in NVPTX
644644
// back-end.
645645
const char *PtxFeature = nullptr;
646-
switch (*CudaVersion) {
646+
switch (*Version) {
647647
#define CASE_CUDA_VERSION(CUDA_VER, PTX_VER) \
648648
case CudaVersion::CUDA_##CUDA_VER: \
649649
PtxFeature = "+ptx" #PTX_VER; \

clang/lib/Driver/ToolChains/Cuda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class LLVM_LIBRARY_VISIBILITY OpenMPLinker : public Tool {
127127
void getNVPTXTargetFeatures(const Driver &D, const llvm::Triple &Triple,
128128
const llvm::opt::ArgList &Args,
129129
std::vector<StringRef> &Features,
130-
Optional<clang::CudaVersion> CudaVersion = None);
130+
Optional<clang::CudaVersion> Version = None);
131131

132132
} // end namespace NVPTX
133133
} // end namespace tools

0 commit comments

Comments
 (0)