src/tests/compiler_tests/IntermNode_test.cpp


Log

Author Commit Date CI Message
Olli Etuaho d0bad2c7 2016-09-09T18:01:16 Split ternary node class from TIntermSelection Ternary operator nodes are typed parts of expressions, they always have two children and the children are also guaranteed to be TIntermTyped. "If" selection nodes can't be a part of an expression, they can have either one or two children and the children are code blocks. Due to all of these differences it makes sense to store these using two different AST node classes. BUG=angleproject:1490 TEST=angle_unittests Change-Id: I913ab1d806e3cdb5c21106f078cc9c0b6c72ac54 Reviewed-on: https://chromium-review.googlesource.com/384512 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho a223430c 2016-08-31T12:05:39 Promote unary nodes automatically Unary nodes now get their type set automatically based on the operation and operand. The operand should only be changed to another of the same type after the node is constructed. The operation can't be changed on unary and binary nodes after they've been constructed. BUG=angleproject:1490 TEST=angle_unittests Change-Id: Ib1ea3dcb1162261966c02d5f03d8091cf647fac1 Reviewed-on: https://chromium-review.googlesource.com/378935 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 3272a6d3 2016-08-29T17:54:50 Promote and fold indexing nodes similarly to other binary ops Indexing nodes now get their type set in TIntermBinary::promote, same as math and logic ops. They are also constant folded through TIntermBinary::fold() instead of having special functions for constant folding them in ParseContext. Index nodes for struct and interface block member access now always have integer type, instead of sometimes having the type of the field they were used to access. Usage of TIntermBinary constructor is cleaned up so only the constructor that takes in left and right operands is used. The type of TIntermBinary nodes is always determined automatically. Together these changes make the code considerably cleaner. Note that the code for constant folding for array indexing is actually never hit because constant folding array constructors is still intentionally disabled in the code. BUG=angleproject:1490 TEST=angle_unittests Change-Id: Ifcec45257476cdb0d495c7d72e3cf2f83388e8c5 Reviewed-on: https://chromium-review.googlesource.com/377961 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 76037953 2015-08-20T13:18:44 Fix compilation on Mac, adding a newline in IntermNode_test.cpp BUG= Change-Id: Ie935486bf44bacb89660419c0dabd0ff38838c90 Reviewed-on: https://chromium-review.googlesource.com/294800 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho d0d59aa4 2015-08-18T13:49:45 Add deep copying support for typed AST nodes Removing dynamic indexing of vectors and matrices will require copying the indexed nodes in case they are written. Any type of l-value node that doesn't have side effects may need to be copied. Add a copying function for all typed node classes so that this copying can be performed. Private copy constructors are used to implement the deepCopy function in order to make maintenance easier. With copy constructors, each subclass only needs to take care of copying its own members, and not the base class members, which reduces the possibility of errors. Copy constructors are disabled for all node classes that don't support deep copying by inheriting TIntermNode from angle::NonCopyable. Assignment operator is disabled for all node classes through inheriting angle::NonCopyable. This applies also to classes that now get the private copy constructor. Explicit copy constructor and assignment operator declarations are added to some classes which show up in node member variables to make code clearer. BUG=angleproject:1116 TEST=angle_unittests Change-Id: Ia757b69397837f8309f0e7511c0cd24ca2c7a721 Reviewed-on: https://chromium-review.googlesource.com/293931 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>