Skip to content

Commit b217494

Browse files
committed
review comment:
- use already declared function
1 parent 9d300da commit b217494

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

clang/lib/Sema/SemaHLSL.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -1894,15 +1894,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
18941894
if (CheckUnsignedIntRepresentation(&SemaRef, TheCall))
18951895
return true;
18961896

1897-
// Set the return type to be a scalar or vector of same length of double
1898-
ASTContext &Ctx = SemaRef.getASTContext();
1899-
auto *VTy = TheCall->getArg(0)->getType()->getAs<VectorType>();
1900-
1901-
QualType ResultType =
1902-
VTy ? Ctx.getVectorType(Ctx.DoubleTy, VTy->getNumElements(),
1903-
VTy->getVectorKind())
1904-
: Ctx.DoubleTy;
1905-
TheCall->setType(ResultType);
1897+
SetElementTypeAsReturnType(&SemaRef, TheCall, getASTContext().DoubleTy);
19061898
break;
19071899
}
19081900
case Builtin::BI__builtin_hlsl_elementwise_clamp: {

0 commit comments

Comments
 (0)