Skip to content

Commit c598f1b

Browse files
committed
[Review] Drop the caller is device condition
1 parent f6d26ff commit c598f1b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6736,16 +6736,13 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
67366736

67376737
checkDirectCallValidity(*this, Fn, FD, ArgExprs);
67386738

6739-
// If this expression is a call to a builtin function in HIP device
6739+
// If this expression is a call to a builtin function in HIP
67406740
// compilation, allow a pointer-type argument to default address space to be
67416741
// passed as a pointer-type parameter to a non-default address space.
67426742
// If Arg is declared in the default address space and Param is declared
67436743
// in a non-default address space, perform an implicit address space cast to
67446744
// the parameter type.
6745-
FunctionDecl *Caller = getCurFunctionDecl(/*AllowLambda =*/true);
6746-
bool CallerIsDevice = Caller && (Caller->hasAttr<CUDAGlobalAttr>() ||
6747-
Caller->hasAttr<CUDADeviceAttr>());
6748-
if (getLangOpts().HIP && CallerIsDevice && FD && FD->getBuiltinID()) {
6745+
if (getLangOpts().HIP && FD && FD->getBuiltinID()) {
67496746
for (unsigned Idx = 0; Idx < ArgExprs.size() && Idx < FD->param_size();
67506747
++Idx) {
67516748
ParmVarDecl *Param = FD->getParamDecl(Idx);

0 commit comments

Comments
 (0)