@@ -805,7 +805,7 @@ static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) {
805
805
return TheRecordDecl;
806
806
}
807
807
808
- const HLSLAttributedResourceType *
808
+ static const HLSLAttributedResourceType *
809
809
findAttributedResourceTypeOnField (VarDecl *VD) {
810
810
assert (VD != nullptr && " expected VarDecl" );
811
811
if (RecordDecl *RD = getRecordDeclFromVarDecl (VD)) {
@@ -1417,7 +1417,7 @@ void SemaHLSL::DiagnoseAvailabilityViolations(TranslationUnitDecl *TU) {
1417
1417
}
1418
1418
1419
1419
// Helper function for CheckHLSLBuiltinFunctionCall
1420
- bool CheckVectorElementCallArgs (Sema *S, CallExpr *TheCall) {
1420
+ static bool CheckVectorElementCallArgs (Sema *S, CallExpr *TheCall) {
1421
1421
assert (TheCall->getNumArgs () > 1 );
1422
1422
ExprResult A = TheCall->getArg (0 );
1423
1423
@@ -1467,7 +1467,7 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
1467
1467
return true ;
1468
1468
}
1469
1469
1470
- bool CheckArgsTypesAreCorrect (
1470
+ static bool CheckArgsTypesAreCorrect (
1471
1471
Sema *S, CallExpr *TheCall, QualType ExpectedType,
1472
1472
llvm::function_ref<bool (clang::QualType PassedType)> Check) {
1473
1473
for (unsigned i = 0 ; i < TheCall->getNumArgs (); ++i) {
@@ -1485,15 +1485,15 @@ bool CheckArgsTypesAreCorrect(
1485
1485
return false ;
1486
1486
}
1487
1487
1488
- bool CheckAllArgsHaveFloatRepresentation (Sema *S, CallExpr *TheCall) {
1488
+ static bool CheckAllArgsHaveFloatRepresentation (Sema *S, CallExpr *TheCall) {
1489
1489
auto checkAllFloatTypes = [](clang::QualType PassedType) -> bool {
1490
1490
return !PassedType->hasFloatingRepresentation ();
1491
1491
};
1492
1492
return CheckArgsTypesAreCorrect (S, TheCall, S->Context .FloatTy ,
1493
1493
checkAllFloatTypes);
1494
1494
}
1495
1495
1496
- bool CheckFloatOrHalfRepresentations (Sema *S, CallExpr *TheCall) {
1496
+ static bool CheckFloatOrHalfRepresentations (Sema *S, CallExpr *TheCall) {
1497
1497
auto checkFloatorHalf = [](clang::QualType PassedType) -> bool {
1498
1498
clang::QualType BaseType =
1499
1499
PassedType->isVectorType ()
@@ -1505,7 +1505,7 @@ bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
1505
1505
checkFloatorHalf);
1506
1506
}
1507
1507
1508
- bool CheckNoDoubleVectors (Sema *S, CallExpr *TheCall) {
1508
+ static bool CheckNoDoubleVectors (Sema *S, CallExpr *TheCall) {
1509
1509
auto checkDoubleVector = [](clang::QualType PassedType) -> bool {
1510
1510
if (const auto *VecTy = PassedType->getAs <VectorType>())
1511
1511
return VecTy->getElementType ()->isDoubleType ();
@@ -1514,7 +1514,7 @@ bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
1514
1514
return CheckArgsTypesAreCorrect (S, TheCall, S->Context .FloatTy ,
1515
1515
checkDoubleVector);
1516
1516
}
1517
- bool CheckFloatingOrSignedIntRepresentation (Sema *S, CallExpr *TheCall) {
1517
+ static bool CheckFloatingOrSignedIntRepresentation (Sema *S, CallExpr *TheCall) {
1518
1518
auto checkAllSignedTypes = [](clang::QualType PassedType) -> bool {
1519
1519
return !PassedType->hasSignedIntegerRepresentation () &&
1520
1520
!PassedType->hasFloatingRepresentation ();
@@ -1523,16 +1523,16 @@ bool CheckFloatingOrSignedIntRepresentation(Sema *S, CallExpr *TheCall) {
1523
1523
checkAllSignedTypes);
1524
1524
}
1525
1525
1526
- bool CheckUnsignedIntRepresentation (Sema *S, CallExpr *TheCall) {
1526
+ static bool CheckUnsignedIntRepresentation (Sema *S, CallExpr *TheCall) {
1527
1527
auto checkAllUnsignedTypes = [](clang::QualType PassedType) -> bool {
1528
1528
return !PassedType->hasUnsignedIntegerRepresentation ();
1529
1529
};
1530
1530
return CheckArgsTypesAreCorrect (S, TheCall, S->Context .UnsignedIntTy ,
1531
1531
checkAllUnsignedTypes);
1532
1532
}
1533
1533
1534
- void SetElementTypeAsReturnType (Sema *S, CallExpr *TheCall,
1535
- QualType ReturnType) {
1534
+ static void SetElementTypeAsReturnType (Sema *S, CallExpr *TheCall,
1535
+ QualType ReturnType) {
1536
1536
auto *VecTyA = TheCall->getArg (0 )->getType ()->getAs <VectorType>();
1537
1537
if (VecTyA)
1538
1538
ReturnType = S->Context .getVectorType (ReturnType, VecTyA->getNumElements (),
0 commit comments