Skip to content

[NFC] containsLongVector -> ContainsLongVector #7255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/clang/include/clang/Sema/SemaHLSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ unsigned CaculateInitListArraySizeForHLSL(clang::Sema *sema,
const clang::InitListExpr *InitList,
const clang::QualType EltTy);

bool containsLongVector(clang::QualType qt);
bool ContainsLongVector(clang::QualType);

bool IsConversionToLessOrEqualElements(clang::Sema *self,
const clang::ExprResult &sourceExpr,
Expand Down
2 changes: 1 addition & 1 deletion tools/clang/lib/Sema/SemaDXR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ void DiagnoseTraceCall(Sema &S, const VarDecl *Payload,
return;
}

if (containsLongVector(Payload->getType())) {
if (ContainsLongVector(Payload->getType())) {
const unsigned PayloadParametersIdx = 10;
S.Diag(Payload->getLocation(), diag::err_hlsl_unsupported_long_vector)
<< PayloadParametersIdx;
Expand Down
24 changes: 12 additions & 12 deletions tools/clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5257,7 +5257,7 @@ class HLSLExternalSource : public ExternalSemaSource {
m_sema->RequireCompleteType(argSrcLoc, argType,
diag::err_typecheck_decl_incomplete_type);

if (containsLongVector(argType)) {
if (ContainsLongVector(argType)) {
const unsigned ConstantBuffersOrTextureBuffersIdx = 0;
m_sema->Diag(argSrcLoc, diag::err_hlsl_unsupported_long_vector)
<< ConstantBuffersOrTextureBuffersIdx;
Expand Down Expand Up @@ -5365,7 +5365,7 @@ class HLSLExternalSource : public ExternalSemaSource {
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
if (Decl && !Decl->isCompleteDefinition())
return true;
if (containsLongVector(arg.getAsType())) {
if (ContainsLongVector(arg.getAsType())) {
const unsigned TessellationPatchesIDx = 1;
m_sema->Diag(argLoc.getLocation(),
diag::err_hlsl_unsupported_long_vector)
Expand All @@ -5384,7 +5384,7 @@ class HLSLExternalSource : public ExternalSemaSource {
CXXRecordDecl *Decl = arg.getAsType()->getAsCXXRecordDecl();
if (Decl && !Decl->isCompleteDefinition())
return true;
if (containsLongVector(arg.getAsType())) {
if (ContainsLongVector(arg.getAsType())) {
const unsigned GeometryStreamsIdx = 2;
m_sema->Diag(argLoc.getLocation(),
diag::err_hlsl_unsupported_long_vector)
Expand Down Expand Up @@ -12179,14 +12179,14 @@ bool hlsl::ShouldSkipNRVO(clang::Sema &sema, clang::QualType returnType,
return false;
}

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

while (const ArrayType *Arr = qt->getAsArrayTypeUnsafe())
qt = Arr->getElementType();
while (const ArrayType *Arr = QT->getAsArrayTypeUnsafe())
QT = Arr->getElementType();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an accidental reformat mistake here.


if (CXXRecordDecl *Decl = qt->getAsCXXRecordDecl()) {
if (CXXRecordDecl *Decl = QT->getAsCXXRecordDecl()) {
if (!Decl->isCompleteDefinition())
return false;
return Decl->hasHLSLLongVector();
Expand Down Expand Up @@ -14831,7 +14831,7 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC, Expr *BitWidth,
virtual void diagnose(Sema &S, SourceLocation Loc, QualType T) {}
} SD;
RequireCompleteType(D.getLocStart(), qt, SD);
if (containsLongVector(qt)) {
if (ContainsLongVector(qt)) {
unsigned CbuffersOrTbuffersIdx = 4;
Diag(D.getLocStart(), diag::err_hlsl_unsupported_long_vector)
<< CbuffersOrTbuffersIdx;
Expand Down Expand Up @@ -15729,7 +15729,7 @@ static bool isRelatedDeclMarkedNointerpolation(Expr *E) {

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

if (containsLongVector(FD->getReturnType())) {
if (ContainsLongVector(FD->getReturnType())) {
const unsigned EntryFunctionReturnIdx = 7;
S.Diag(FD->getLocation(), diag::err_hlsl_unsupported_long_vector)
<< EntryFunctionReturnIdx;
Expand Down
4 changes: 2 additions & 2 deletions tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,14 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
}
}
for (const auto *param : pPatchFnDecl->params())
if (containsLongVector(param->getType())) {
if (ContainsLongVector(param->getType())) {
const unsigned PatchConstantFunctionParametersIdx = 8;
self->Diag(param->getLocation(),
diag::err_hlsl_unsupported_long_vector)
<< PatchConstantFunctionParametersIdx;
}

if (containsLongVector(pPatchFnDecl->getReturnType())) {
if (ContainsLongVector(pPatchFnDecl->getReturnType())) {
const unsigned PatchConstantFunctionReturnIdx = 9;
self->Diag(pPatchFnDecl->getLocation(),
diag::err_hlsl_unsupported_long_vector)
Expand Down
Loading