Skip to content

Commit 78c4bda

Browse files
committed
address pr comments
1 parent b21e880 commit 78c4bda

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18073,9 +18073,8 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
1807318073
}
1807418074
if (!E->getArg(0)->getType()->hasFloatingRepresentation())
1807518075
llvm_unreachable("isinf operand must have a float representation");
18076-
return Builder.CreateIntrinsic(
18077-
/*ReturnType=*/retType, Intrinsic::dx_isinf, ArrayRef<Value *>{Op0},
18078-
nullptr, "dx.isinf");
18076+
return Builder.CreateIntrinsic(retType, Intrinsic::dx_isinf,
18077+
ArrayRef<Value *>{Op0}, nullptr, "dx.isinf");
1807918078
}
1808018079
case Builtin::BI__builtin_hlsl_mad: {
1808118080
Value *M = EmitScalarExpr(E->getArg(0));

clang/lib/Sema/SemaChecking.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5268,8 +5268,8 @@ bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) {
52685268
return false;
52695269
}
52705270

5271-
void SetInputRepresentationReturnType(Sema *S, CallExpr *TheCall,
5272-
QualType ReturnType) {
5271+
void SetElementTypeAsReturnType(Sema *S, CallExpr *TheCall,
5272+
QualType ReturnType) {
52735273
auto *VecTyA = TheCall->getArg(0)->getType()->getAs<VectorType>();
52745274
if (VecTyA)
52755275
ReturnType = S->Context.getVectorType(ReturnType, VecTyA->getNumElements(),
@@ -5300,7 +5300,7 @@ bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
53005300
return true;
53015301
if (CheckAllArgsHaveFloatRepresentation(this, TheCall))
53025302
return true;
5303-
SetInputRepresentationReturnType(this, TheCall, this->Context.BoolTy);
5303+
SetElementTypeAsReturnType(this, TheCall, this->Context.BoolTy);
53045304
break;
53055305
case Builtin::BI__builtin_hlsl_elementwise_rcp:
53065306
case Builtin::BI__builtin_hlsl_elementwise_frac: {

0 commit comments

Comments
 (0)