[NFCI] Add LinearPolyBase as base class for ElementCount, TypeSize and StackOffset.
This patch adds a linear polynomial base class, called LinearPolyBase, which
serves as a base class for ElementCount, TypeSize and StackOffset.
It tries to represent a linear polynomial like:
c0 * scale0 + c1 * scale1 + ... + cK * scaleK
where the scale is implicit, meaning that only the coefficients are
encoded. From LinearPolyBase, other classes are derived:
class LinearPolyBase<Type, Dimensions, IsUnivariate>
^
|
+---- using StackOffsetBase = PolyBase<int64_t, 2, false>
^ ^
| |
| class StackOffset : StackOffsetBase
|
+---- using PolySizeBase<T> = PolyBase<T, 2, true>
^
|
class PolySize<T> : PolySizeBase<T>
^
|
+-------- using ElementCount = PolySize<unsigned>
|
+-------- class TypeSize : PolySize<uint64_t>
The plan is for class TypeSize to become a using/typedef as well.