Skip to content

Commit

Permalink
[CUDA] Accept -x cu to indicate language is CUDA, transfer CUDA langu…
Browse files Browse the repository at this point in the history
…age flag to header-file arguments

Summary:
* accept -x cu to indicate language is CUDA
* transfer CUDA language flag to header-file arguments

Differential Revision: https://reviews.llvm.org/D77451
  • Loading branch information
ADRA authored and Artem-B committed Apr 9, 2020
1 parent eccfa35 commit 6ed88af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clang/lib/Driver/Types.cpp
Expand Up @@ -295,7 +295,10 @@ types::ID types::lookupTypeForTypeSpecifier(const char *Name) {
strcmp(Name, getInfo(Id).Name) == 0)
return Id;
}

// Accept "cu" as an alias for "cuda" for NVCC compatibility
if (strcmp(Name, "cu") == 0) {
return types::TY_CUDA;
}
return TY_INVALID;
}

Expand Down
3 changes: 3 additions & 0 deletions clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
Expand Up @@ -114,6 +114,9 @@ static types::ID foldType(types::ID Lang) {
case types::TY_ObjCXX:
case types::TY_ObjCXXHeader:
return types::TY_ObjCXX;
case types::TY_CUDA:
case types::TY_CUDA_DEVICE:
return types::TY_CUDA:
default:
return types::TY_INVALID;
}
Expand Down

0 comments on commit 6ed88af

Please sign in to comment.