HLSL: Grammar: Generalize accepting a declaration to accept an aggregate of subtrees.
This is slightly cleaner today for entry-point wrapping, which sometimes made two subtrees for a function definition instead of just one subtree. It will be critical though for recognizing a struct with multiple member functions.
This commit is contained in:
parent
057df2935a
commit
ca71d946d7
5 changed files with 49 additions and 44 deletions
|
|
@ -1158,15 +1158,15 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r
|
|||
return nullptr;
|
||||
|
||||
TIntermAggregate* aggNode = nullptr;
|
||||
if (left)
|
||||
if (left != nullptr)
|
||||
aggNode = left->getAsAggregate();
|
||||
if (! aggNode || aggNode->getOp() != EOpNull) {
|
||||
if (aggNode == nullptr || aggNode->getOp() != EOpNull) {
|
||||
aggNode = new TIntermAggregate;
|
||||
if (left)
|
||||
if (left != nullptr)
|
||||
aggNode->getSequence().push_back(left);
|
||||
}
|
||||
|
||||
if (right)
|
||||
if (right != nullptr)
|
||||
aggNode->getSequence().push_back(right);
|
||||
|
||||
return aggNode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue