================ @@ -5743,6 +5747,17 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +const CXXRecordDecl *HLSLBufferDecl::getLayoutStruct() const { + // Layout struct is the last decl in the HLSLBufferDecl. + if (CXXRecordDecl *RD = llvm::dyn_cast_or_null<CXXRecordDecl>(LastDecl)) { ---------------- hekota wrote:
My thoughts were that since we are creating the layout struct, we can guarantee it is going to be the last one in the `HLSLBufferDecl` context, and there is an assert verifying that. I used `LastDecl` to avoid adding additional member to `HLSLBufferDecl` and it seemed to be a safe option (the FIXME comment is 17 years old). I will add an explicit field for the layout struct to make it cleaner. https://github.com/llvm/llvm-project/pull/124886 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits