================ @@ -5671,6 +5671,54 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +static uint64_t calculateLegacyCbufferAlign(const ASTContext &Context, + QualType T) { + if (T->isAggregateType()) + return 128; + else if (const VectorType *VT = T->getAs<VectorType>()) + return Context.getTypeSize(VT->getElementType()); + else + return Context.getTypeSize(T); +} + +unsigned HLSLBufferDecl::calculateLegacyCbufferSize(const ASTContext &Context, ---------------- llvm-beanz wrote:
This function seems like something we should be able to have some unit tests of. Can we write unit tests that exercise this through a bunch of the interesting variations to ensure it does the right thing? https://github.com/llvm/llvm-project/pull/91999 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits