Types: Fix #1290: Rationalize and correct "mixed" style array dimensioning.
There a couple functional problems, which when reduced down also led to some good simplifications and rationalization. So, this commit: - corrects "mixed" functionality: int[A] f[B] -> f[B][A] - correct multi-identifier decls: int[A] f[B], g[C] -> f and g are independently sized. - increases symmetry between different places in the code that do this - makes fewer ways to do the same thing; several methods are just gone now - makes more clear when something is copied or shared
This commit is contained in:
parent
1c3ab274b1
commit
859b0342b8
17 changed files with 1323 additions and 1289 deletions
|
|
@ -130,10 +130,10 @@ struct TSmallArrayVector {
|
|||
sizes->push_back(pair);
|
||||
}
|
||||
|
||||
void push_front(const TSmallArrayVector& newDims)
|
||||
void push_back(const TSmallArrayVector& newDims)
|
||||
{
|
||||
alloc();
|
||||
sizes->insert(sizes->begin(), newDims.sizes->begin(), newDims.sizes->end());
|
||||
sizes->insert(sizes->end(), newDims.sizes->begin(), newDims.sizes->end());
|
||||
}
|
||||
|
||||
void pop_front()
|
||||
|
|
@ -252,6 +252,7 @@ struct TArraySizes {
|
|||
void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); }
|
||||
void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); }
|
||||
void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); }
|
||||
void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); }
|
||||
void changeOuterSize(int s) { sizes.changeFront((unsigned)s); }
|
||||
int getImplicitSize() const { return (int)implicitArraySize; }
|
||||
void setImplicitSize(int s) { implicitArraySize = s; }
|
||||
|
|
@ -288,7 +289,6 @@ struct TArraySizes {
|
|||
}
|
||||
|
||||
bool isImplicit() const { return getOuterSize() == UnsizedArraySize || isInnerImplicit(); }
|
||||
void addOuterSizes(const TArraySizes& s) { sizes.push_front(s.sizes); }
|
||||
void dereference() { sizes.pop_front(); }
|
||||
void copyDereferenced(const TArraySizes& rhs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue