Skip to content

Commit 2d5fd22

Browse files
committed
use new attr
1 parent 8cc2154 commit 2d5fd22

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -740,16 +740,13 @@ void hlsl::DiagnoseTranslationUnit(clang::Sema *self) {
740740
HLSLCallDiagnoseVisitor Visitor(self, shaderModel, EntrySK, NodeLaunchTy,
741741
nullptr, DiagnosedCalls,
742742
DeclAvailabilityChecked);
743-
if (InitListExpr *ILE = dyn_cast<InitListExpr>(VD->getInit())) {
744-
if (auto RT = ILE->getType()->getAs<RecordType>()) {
745-
if (const RecordDecl *RD = RT->getDecl()) {
746-
if (RD->getName() == "RaytracingPipelineConfig1") {
747-
Visitor.TraverseDecl(VD);
748-
}
749-
}
750-
}
743+
QualType QT = VD->getType();
744+
if (const RecordType *RT = QT->getAs<RecordType>()) {
745+
RecordDecl *RD = RT->getDecl();
746+
if (!RD->hasAttr<HLSLSubObjectAttr>())
747+
continue;
748+
Visitor.TraverseDecl(VD);
751749
}
752-
break;
753750
}
754751
}
755752
}

0 commit comments

Comments
 (0)