-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
The goal should likely be to replace the constexpr MaxElementsPerDimension with this language option.
llvm-project/clang/include/clang/AST/TypeBase.h
Lines 4371 to 4379 in 129c683
| class ConstantMatrixType final : public MatrixType { | |
| protected: | |
| friend class ASTContext; | |
| /// Number of rows and columns. | |
| unsigned NumRows; | |
| unsigned NumColumns; | |
| static constexpr unsigned MaxElementsPerDimension = (1 << 20) - 1; |
But that would require updating all of these static constexpr functions with something that takes a SemaPtr
llvm-project/clang/include/clang/AST/TypeBase.h
Lines 4399 to 4407 in 129c683
| /// Returns true if \p NumElements is a valid matrix dimension. | |
| static constexpr bool isDimensionValid(size_t NumElements) { | |
| return NumElements > 0 && NumElements <= MaxElementsPerDimension; | |
| } | |
| /// Returns the maximum number of elements per dimension. | |
| static constexpr unsigned getMaxElementsPerDimension() { | |
| return MaxElementsPerDimension; | |
| } |
For now we will make this an HLSL only language opt and create an issue to make it more generic:
VALUE_LANGOPT(HLSLMaxMatrixDimension, 32, 4, NotCompatible, "maximum allowed matrix dimension")
Originally posted by @farzonl in #159446 (comment)
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"