Skip to content

Commit eddbd4e

Browse files
authored
[clang][NFC] add static for internal linkage function (#109436)
Detected by clang-tidy misc-use-internal-linkage
1 parent 9d3a576 commit eddbd4e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7342,7 +7342,7 @@ static void copyAttrFromTypedefToDecl(Sema &S, Decl *D, const TypedefType *TT) {
73427342
// This function emits warning and a corresponding note based on the
73437343
// ReadOnlyPlacementAttr attribute. The warning checks that all global variable
73447344
// declarations of an annotated type must be const qualified.
7345-
void emitReadOnlyPlacementAttrWarning(Sema &S, const VarDecl *VD) {
7345+
static void emitReadOnlyPlacementAttrWarning(Sema &S, const VarDecl *VD) {
73467346
QualType VarType = VD->getType().getCanonicalType();
73477347

73487348
// Ignore local declarations (for now) and those with const qualification.

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) {
805805
return TheRecordDecl;
806806
}
807807

808-
const HLSLAttributedResourceType *
808+
static const HLSLAttributedResourceType *
809809
findAttributedResourceTypeOnField(VarDecl *VD) {
810810
assert(VD != nullptr && "expected VarDecl");
811811
if (RecordDecl *RD = getRecordDeclFromVarDecl(VD)) {
@@ -1417,7 +1417,7 @@ void SemaHLSL::DiagnoseAvailabilityViolations(TranslationUnitDecl *TU) {
14171417
}
14181418

14191419
// Helper function for CheckHLSLBuiltinFunctionCall
1420-
bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
1420+
static bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
14211421
assert(TheCall->getNumArgs() > 1);
14221422
ExprResult A = TheCall->getArg(0);
14231423

@@ -1467,7 +1467,7 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
14671467
return true;
14681468
}
14691469

1470-
bool CheckArgsTypesAreCorrect(
1470+
static bool CheckArgsTypesAreCorrect(
14711471
Sema *S, CallExpr *TheCall, QualType ExpectedType,
14721472
llvm::function_ref<bool(clang::QualType PassedType)> Check) {
14731473
for (unsigned i = 0; i < TheCall->getNumArgs(); ++i) {
@@ -1485,15 +1485,15 @@ bool CheckArgsTypesAreCorrect(
14851485
return false;
14861486
}
14871487

1488-
bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) {
1488+
static bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) {
14891489
auto checkAllFloatTypes = [](clang::QualType PassedType) -> bool {
14901490
return !PassedType->hasFloatingRepresentation();
14911491
};
14921492
return CheckArgsTypesAreCorrect(S, TheCall, S->Context.FloatTy,
14931493
checkAllFloatTypes);
14941494
}
14951495

1496-
bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
1496+
static bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
14971497
auto checkFloatorHalf = [](clang::QualType PassedType) -> bool {
14981498
clang::QualType BaseType =
14991499
PassedType->isVectorType()
@@ -1505,7 +1505,7 @@ bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
15051505
checkFloatorHalf);
15061506
}
15071507

1508-
bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
1508+
static bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
15091509
auto checkDoubleVector = [](clang::QualType PassedType) -> bool {
15101510
if (const auto *VecTy = PassedType->getAs<VectorType>())
15111511
return VecTy->getElementType()->isDoubleType();
@@ -1514,7 +1514,7 @@ bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
15141514
return CheckArgsTypesAreCorrect(S, TheCall, S->Context.FloatTy,
15151515
checkDoubleVector);
15161516
}
1517-
bool CheckFloatingOrSignedIntRepresentation(Sema *S, CallExpr *TheCall) {
1517+
static bool CheckFloatingOrSignedIntRepresentation(Sema *S, CallExpr *TheCall) {
15181518
auto checkAllSignedTypes = [](clang::QualType PassedType) -> bool {
15191519
return !PassedType->hasSignedIntegerRepresentation() &&
15201520
!PassedType->hasFloatingRepresentation();
@@ -1523,16 +1523,16 @@ bool CheckFloatingOrSignedIntRepresentation(Sema *S, CallExpr *TheCall) {
15231523
checkAllSignedTypes);
15241524
}
15251525

1526-
bool CheckUnsignedIntRepresentation(Sema *S, CallExpr *TheCall) {
1526+
static bool CheckUnsignedIntRepresentation(Sema *S, CallExpr *TheCall) {
15271527
auto checkAllUnsignedTypes = [](clang::QualType PassedType) -> bool {
15281528
return !PassedType->hasUnsignedIntegerRepresentation();
15291529
};
15301530
return CheckArgsTypesAreCorrect(S, TheCall, S->Context.UnsignedIntTy,
15311531
checkAllUnsignedTypes);
15321532
}
15331533

1534-
void SetElementTypeAsReturnType(Sema *S, CallExpr *TheCall,
1535-
QualType ReturnType) {
1534+
static void SetElementTypeAsReturnType(Sema *S, CallExpr *TheCall,
1535+
QualType ReturnType) {
15361536
auto *VecTyA = TheCall->getArg(0)->getType()->getAs<VectorType>();
15371537
if (VecTyA)
15381538
ReturnType = S->Context.getVectorType(ReturnType, VecTyA->getNumElements(),

0 commit comments

Comments
 (0)