@@ -29,13 +29,14 @@ namespace clang {
29
29
30
30
SemaSPIRV::SemaSPIRV (Sema &S) : SemaBase(S) {}
31
31
32
- // / Checks if the first `NumArgsToCheck` arguments of a function call are of vector type.
33
- // / If any of the arguments is not a vector type, it emits a diagnostic error and returns `true`.
34
- // / Otherwise, it returns `false`.
32
+ // / Checks if the first `NumArgsToCheck` arguments of a function call are of
33
+ // / vector type. If any of the arguments is not a vector type, it emits a
34
+ // / diagnostic error and returns `true`. Otherwise, it returns `false`.
35
35
// /
36
36
// / \param TheCall The function call expression to check.
37
37
// / \param NumArgsToCheck The number of arguments to check for vector type.
38
- // / \return `true` if any of the arguments is not a vector type, `false` otherwise.
38
+ // / \return `true` if any of the arguments is not a vector type, `false`
39
+ // / otherwise.
39
40
40
41
bool SemaSPIRV::CheckVectorArgs (CallExpr *TheCall, unsigned NumArgsToCheck) {
41
42
for (unsigned i = 0 ; i < NumArgsToCheck; ++i) {
@@ -187,7 +188,8 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const TargetInfo &TI,
187
188
if (CheckVectorArgs (TheCall, 2 ))
188
189
return true ;
189
190
190
- QualType RetTy = TheCall->getArg (0 )->getType ()->getAs <VectorType>()->getElementType ();
191
+ QualType RetTy =
192
+ TheCall->getArg (0 )->getType ()->getAs <VectorType>()->getElementType ();
191
193
TheCall->setType (RetTy);
192
194
break ;
193
195
}
@@ -199,7 +201,8 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const TargetInfo &TI,
199
201
if (CheckVectorArgs (TheCall, 1 ))
200
202
return true ;
201
203
202
- QualType RetTy = TheCall->getArg (0 )->getType ()->getAs <VectorType>()->getElementType ();
204
+ QualType RetTy =
205
+ TheCall->getArg (0 )->getType ()->getAs <VectorType>()->getElementType ();
203
206
TheCall->setType (RetTy);
204
207
break ;
205
208
}
@@ -215,8 +218,7 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const TargetInfo &TI,
215
218
QualType ArgTyC = C.get ()->getType ();
216
219
if (!ArgTyC->isFloatingType ()) {
217
220
SemaRef.Diag (C.get ()->getBeginLoc (), diag::err_builtin_invalid_arg_type)
218
- << 3 << /* scalar*/ 5 << /* no int */ 0 << /* fp */ 1
219
- << ArgTyC;
221
+ << 3 << /* scalar*/ 5 << /* no int */ 0 << /* fp */ 1 << ArgTyC;
220
222
return true ;
221
223
}
222
224
0 commit comments