Skip to content

Commit 9e91844

Browse files
authored
[NFC] containsLongVector -> ContainsLongVector (microsoft#7255)
I provided feedback during code review that this function should be named following LLVM conventions. That feedback did not account for the fact that SemaHLSL is otherwise consistent using CamelCase instead of camelCase naming. This corrects my error by renaming to match the consistent style in SemaHLSL.h. I've also updated the parameter naming in the source file to conform to LLVM style since I was in the area anyways.
1 parent 0ffd60a commit 9e91844

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

tools/clang/include/clang/Sema/SemaHLSL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ unsigned CaculateInitListArraySizeForHLSL(clang::Sema *sema,
128128
const clang::InitListExpr *InitList,
129129
const clang::QualType EltTy);
130130

131-
bool containsLongVector(clang::QualType qt);
131+
bool ContainsLongVector(clang::QualType);
132132

133133
bool IsConversionToLessOrEqualElements(clang::Sema *self,
134134
const clang::ExprResult &sourceExpr,

tools/clang/lib/Sema/SemaDXR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ void DiagnoseTraceCall(Sema &S, const VarDecl *Payload,
810810
return;
811811
}
812812

813-
if (containsLongVector(Payload->getType())) {
813+
if (ContainsLongVector(Payload->getType())) {
814814
const unsigned PayloadParametersIdx = 10;
815815
S.Diag(Payload->getLocation(), diag::err_hlsl_unsupported_long_vector)
816816
<< PayloadParametersIdx;

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5529,7 +5529,7 @@ class HLSLExternalSource : public ExternalSemaSource {
55295529
m_sema->RequireCompleteType(argSrcLoc, argType,
55305530
diag::err_typecheck_decl_incomplete_type);
55315531

5532-
if (containsLongVector(argType)) {
5532+
if (ContainsLongVector(argType)) {
55335533
const unsigned ConstantBuffersOrTextureBuffersIdx = 0;
55345534
m_sema->Diag(argSrcLoc, diag::err_hlsl_unsupported_long_vector)
55355535
<< ConstantBuffersOrTextureBuffersIdx;
@@ -5637,7 +5637,7 @@ class HLSLExternalSource : public ExternalSemaSource {
56375637
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
56385638
if (Decl && !Decl->isCompleteDefinition())
56395639
return true;
5640-
if (containsLongVector(arg.getAsType())) {
5640+
if (ContainsLongVector(arg.getAsType())) {
56415641
const unsigned TessellationPatchesIDx = 1;
56425642
m_sema->Diag(argLoc.getLocation(),
56435643
diag::err_hlsl_unsupported_long_vector)
@@ -5656,7 +5656,7 @@ class HLSLExternalSource : public ExternalSemaSource {
56565656
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
56575657
if (Decl && !Decl->isCompleteDefinition())
56585658
return true;
5659-
if (containsLongVector(arg.getAsType())) {
5659+
if (ContainsLongVector(arg.getAsType())) {
56605660
const unsigned GeometryStreamsIdx = 2;
56615661
m_sema->Diag(argLoc.getLocation(),
56625662
diag::err_hlsl_unsupported_long_vector)
@@ -12545,14 +12545,14 @@ bool hlsl::ShouldSkipNRVO(clang::Sema &sema, clang::QualType returnType,
1254512545
return false;
1254612546
}
1254712547

12548-
bool hlsl::containsLongVector(QualType qt) {
12549-
if (qt.isNull() || qt->isDependentType())
12548+
bool hlsl::ContainsLongVector(QualType QT) {
12549+
if (QT.isNull() || QT->isDependentType())
1255012550
return false;
1255112551

12552-
while (const ArrayType *Arr = qt->getAsArrayTypeUnsafe())
12553-
qt = Arr->getElementType();
12552+
while (const ArrayType *Arr = QT->getAsArrayTypeUnsafe())
12553+
QT = Arr->getElementType();
1255412554

12555-
if (CXXRecordDecl *Decl = qt->getAsCXXRecordDecl()) {
12555+
if (CXXRecordDecl *Decl = QT->getAsCXXRecordDecl()) {
1255612556
if (!Decl->isCompleteDefinition())
1255712557
return false;
1255812558
return Decl->hasHLSLLongVector();
@@ -15201,7 +15201,7 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC, Expr *BitWidth,
1520115201
virtual void diagnose(Sema &S, SourceLocation Loc, QualType T) {}
1520215202
} SD;
1520315203
RequireCompleteType(D.getLocStart(), qt, SD);
15204-
if (containsLongVector(qt)) {
15204+
if (ContainsLongVector(qt)) {
1520515205
unsigned CbuffersOrTbuffersIdx = 4;
1520615206
Diag(D.getLocStart(), diag::err_hlsl_unsupported_long_vector)
1520715207
<< CbuffersOrTbuffersIdx;
@@ -16099,7 +16099,7 @@ static bool isRelatedDeclMarkedNointerpolation(Expr *E) {
1609916099

1610016100
// Verify that user-defined intrinsic struct args contain no long vectors
1610116101
static bool CheckUDTIntrinsicArg(Sema *S, Expr *Arg) {
16102-
if (containsLongVector(Arg->getType())) {
16102+
if (ContainsLongVector(Arg->getType())) {
1610316103
const unsigned UserDefinedStructParameterIdx = 5;
1610416104
S->Diag(Arg->getExprLoc(), diag::err_hlsl_unsupported_long_vector)
1610516105
<< UserDefinedStructParameterIdx;
@@ -16842,14 +16842,14 @@ void DiagnoseEntry(Sema &S, FunctionDecl *FD) {
1684216842
// Would be nice to check for resources here as they crash the compiler now.
1684316843
// See issue #7186.
1684416844
for (const auto *param : FD->params()) {
16845-
if (containsLongVector(param->getType())) {
16845+
if (ContainsLongVector(param->getType())) {
1684616846
const unsigned EntryFunctionParametersIdx = 6;
1684716847
S.Diag(param->getLocation(), diag::err_hlsl_unsupported_long_vector)
1684816848
<< EntryFunctionParametersIdx;
1684916849
}
1685016850
}
1685116851

16852-
if (containsLongVector(FD->getReturnType())) {
16852+
if (ContainsLongVector(FD->getReturnType())) {
1685316853
const unsigned EntryFunctionReturnIdx = 7;
1685416854
S.Diag(FD->getLocation(), diag::err_hlsl_unsupported_long_vector)
1685516855
<< EntryFunctionReturnIdx;

tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,14 +710,14 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
710710
}
711711
}
712712
for (const auto *param : pPatchFnDecl->params())
713-
if (containsLongVector(param->getType())) {
713+
if (ContainsLongVector(param->getType())) {
714714
const unsigned PatchConstantFunctionParametersIdx = 8;
715715
self->Diag(param->getLocation(),
716716
diag::err_hlsl_unsupported_long_vector)
717717
<< PatchConstantFunctionParametersIdx;
718718
}
719719

720-
if (containsLongVector(pPatchFnDecl->getReturnType())) {
720+
if (ContainsLongVector(pPatchFnDecl->getReturnType())) {
721721
const unsigned PatchConstantFunctionReturnIdx = 9;
722722
self->Diag(pPatchFnDecl->getLocation(),
723723
diag::err_hlsl_unsupported_long_vector)

0 commit comments

Comments
 (0)