================
@@ -5132,7 +5132,45 @@ void 
SemaHLSL::handleGlobalStructOrArrayOfWithResources(VarDecl *VD) {
   }
 }
 
+bool SemaHLSL::CheckForMipsIntermediateType(QualType T, SourceLocation Loc) {
+  const auto *RT = T->getAs<RecordType>();
+  if (!RT)
+    return false;
+
+  const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl());
+  if (!RD || !RD->isImplicit())
+    return false;
+
+  const DeclContext *DC = RD->getDeclContext();
+  const auto *ParentRD = dyn_cast<CXXRecordDecl>(DC);
+  if (!ParentRD)
+    return false;
+
+  const DeclContext *ParentDC = ParentRD->getDeclContext();
+  QualType ParentTy =
+      SemaRef.getASTContext().getTypeDeclType(cast<TypeDecl>(ParentRD));
+  if (!ParentTy->isHLSLResourceRecord()) {
+    return false;
+  }
+
+  if (!ParentDC->isNamespace() &&
----------------
Keenuts wrote:

`!isNamespace && cast<>` ? Seems like the isNamespace is never true otherwise 
it would crash no?

https://github.com/llvm/llvm-project/pull/186143
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to