Skip to content

Commit 5872713

Browse files
committed
[NFC] containsLongVector -> ContainsLongVector
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 b646ad3 commit 5872713

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

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 qt);
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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5257,7 +5257,7 @@ class HLSLExternalSource : public ExternalSemaSource {
52575257
m_sema->RequireCompleteType(argSrcLoc, argType,
52585258
diag::err_typecheck_decl_incomplete_type);
52595259

5260-
if (containsLongVector(argType)) {
5260+
if (ContainsLongVector(argType)) {
52615261
const unsigned ConstantBuffersOrTextureBuffersIdx = 0;
52625262
m_sema->Diag(argSrcLoc, diag::err_hlsl_unsupported_long_vector)
52635263
<< ConstantBuffersOrTextureBuffersIdx;
@@ -5365,7 +5365,7 @@ class HLSLExternalSource : public ExternalSemaSource {
53655365
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
53665366
if (Decl && !Decl->isCompleteDefinition())
53675367
return true;
5368-
if (containsLongVector(arg.getAsType())) {
5368+
if (ContainsLongVector(arg.getAsType())) {
53695369
const unsigned TessellationPatchesIDx = 1;
53705370
m_sema->Diag(argLoc.getLocation(),
53715371
diag::err_hlsl_unsupported_long_vector)
@@ -5384,7 +5384,7 @@ class HLSLExternalSource : public ExternalSemaSource {
53845384
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
53855385
if (Decl && !Decl->isCompleteDefinition())
53865386
return true;
5387-
if (containsLongVector(arg.getAsType())) {
5387+
if (ContainsLongVector(arg.getAsType())) {
53885388
const unsigned GeometryStreamsIdx = 2;
53895389
m_sema->Diag(argLoc.getLocation(),
53905390
diag::err_hlsl_unsupported_long_vector)
@@ -12179,7 +12179,7 @@ bool hlsl::ShouldSkipNRVO(clang::Sema &sema, clang::QualType returnType,
1217912179
return false;
1218012180
}
1218112181

12182-
bool hlsl::containsLongVector(QualType qt) {
12182+
bool hlsl::ContainsLongVector(QualType qt) {
1218312183
if (qt.isNull() || qt->isDependentType())
1218412184
return false;
1218512185

@@ -14831,7 +14831,7 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC, Expr *BitWidth,
1483114831
virtual void diagnose(Sema &S, SourceLocation Loc, QualType T) {}
1483214832
} SD;
1483314833
RequireCompleteType(D.getLocStart(), qt, SD);
14834-
if (containsLongVector(qt)) {
14834+
if (ContainsLongVector(qt)) {
1483514835
unsigned CbuffersOrTbuffersIdx = 4;
1483614836
Diag(D.getLocStart(), diag::err_hlsl_unsupported_long_vector)
1483714837
<< CbuffersOrTbuffersIdx;
@@ -15729,7 +15729,7 @@ static bool isRelatedDeclMarkedNointerpolation(Expr *E) {
1572915729

1573015730
// Verify that user-defined intrinsic struct args contain no long vectors
1573115731
static bool CheckUDTIntrinsicArg(Sema *S, Expr *Arg) {
15732-
if (containsLongVector(Arg->getType())) {
15732+
if (ContainsLongVector(Arg->getType())) {
1573315733
const unsigned UserDefinedStructParameterIdx = 5;
1573415734
S->Diag(Arg->getExprLoc(), diag::err_hlsl_unsupported_long_vector)
1573515735
<< UserDefinedStructParameterIdx;
@@ -16472,14 +16472,14 @@ void DiagnoseEntry(Sema &S, FunctionDecl *FD) {
1647216472
// Would be nice to check for resources here as they crash the compiler now.
1647316473
// See issue #7186.
1647416474
for (const auto *param : FD->params()) {
16475-
if (containsLongVector(param->getType())) {
16475+
if (ContainsLongVector(param->getType())) {
1647616476
const unsigned EntryFunctionParametersIdx = 6;
1647716477
S.Diag(param->getLocation(), diag::err_hlsl_unsupported_long_vector)
1647816478
<< EntryFunctionParametersIdx;
1647916479
}
1648016480
}
1648116481

16482-
if (containsLongVector(FD->getReturnType())) {
16482+
if (ContainsLongVector(FD->getReturnType())) {
1648316483
const unsigned EntryFunctionReturnIdx = 7;
1648416484
S.Diag(FD->getLocation(), diag::err_hlsl_unsupported_long_vector)
1648516485
<< EntryFunctionReturnIdx;

tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,14 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
641641
}
642642
}
643643
for (const auto *param : pPatchFnDecl->params())
644-
if (containsLongVector(param->getType())) {
644+
if (ContainsLongVector(param->getType())) {
645645
const unsigned PatchConstantFunctionParametersIdx = 8;
646646
self->Diag(param->getLocation(),
647647
diag::err_hlsl_unsupported_long_vector)
648648
<< PatchConstantFunctionParametersIdx;
649649
}
650650

651-
if (containsLongVector(pPatchFnDecl->getReturnType())) {
651+
if (ContainsLongVector(pPatchFnDecl->getReturnType())) {
652652
const unsigned PatchConstantFunctionReturnIdx = 9;
653653
self->Diag(pPatchFnDecl->getLocation(),
654654
diag::err_hlsl_unsupported_long_vector)

0 commit comments

Comments
 (0)