Front-end: Add specialization-constant subtrees for const variables/symbols.
This commit is contained in:
parent
7cc0e2896e
commit
a5845766e0
8 changed files with 61 additions and 23 deletions
|
|
@ -252,11 +252,14 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
|
|||
if (copyOf.numExtensions != 0)
|
||||
setExtensions(copyOf.numExtensions, copyOf.extensions);
|
||||
|
||||
if (! copyOf.unionArray.empty()) {
|
||||
if (! copyOf.constArray.empty()) {
|
||||
assert(! copyOf.type.isStruct());
|
||||
TConstUnionArray newArray(copyOf.unionArray, 0, copyOf.unionArray.size());
|
||||
unionArray = newArray;
|
||||
TConstUnionArray newArray(copyOf.constArray, 0, copyOf.constArray.size());
|
||||
constArray = newArray;
|
||||
}
|
||||
|
||||
// don't support specialization-constant subtrees in cloned tables
|
||||
constSubtree = nullptr;
|
||||
}
|
||||
|
||||
TVariable* TVariable::clone() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue