Skip to content

Commit 011550b

Browse files
committed
[Review] Drop the caller is device condition
1 parent 4479e24 commit 011550b

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
@@ -6728,16 +6728,13 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
67286728

67296729
checkDirectCallValidity(*this, Fn, FD, ArgExprs);
67306730

6731-
// If this expression is a call to a builtin function in HIP device
6731+
// If this expression is a call to a builtin function in HIP
67326732
// compilation, allow a pointer-type argument to default address space to be
67336733
// passed as a pointer-type parameter to a non-default address space.
67346734
// If Arg is declared in the default address space and Param is declared
67356735
// in a non-default address space, perform an implicit address space cast to
67366736
// the parameter type.
6737-
FunctionDecl *Caller = getCurFunctionDecl(/*AllowLambda =*/true);
6738-
bool CallerIsDevice = Caller && (Caller->hasAttr<CUDAGlobalAttr>() ||
6739-
Caller->hasAttr<CUDADeviceAttr>());
6740-
if (getLangOpts().HIP && CallerIsDevice && FD && FD->getBuiltinID()) {
6737+
if (getLangOpts().HIP && FD && FD->getBuiltinID()) {
67416738
for (unsigned Idx = 0; Idx < ArgExprs.size() && Idx < FD->param_size();
67426739
++Idx) {
67436740
ParmVarDecl *Param = FD->getParamDecl(Idx);

0 commit comments

Comments
 (0)