// // Copyright 2018 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // FoldExpressions.cpp: Fold expressions. This may fold expressions so that the qualifier of the // folded node differs from the qualifier of the original expression, so it needs to be done after // parsing and validation of qualifiers is complete. Expressions that are folded: // 1. Ternary ops with a constant condition. // 2. Sequence aka comma ops where the left side has no side effects. // 3. Any expressions containing any of the above. #include "compiler/translator/tree_ops/FoldExpressions.h" #include "compiler/translator/Diagnostics.h" #include "compiler/translator/IntermNode.h" #include "compiler/translator/tree_util/IntermTraverse.h" namespace sh { namespace { class FoldExpressionsTraverser : public TIntermTraverser { … }; } // anonymous namespace bool FoldExpressions(TCompiler *compiler, TIntermBlock *root, TDiagnostics *diagnostics) { … } } // namespace sh