Move AST utilities to a subdirectory
Move AST related utilities to compiler/translator/tree_util.
BUG=angleproject:2409
TEST=angle_unittests
Change-Id: I7567c2f6f2710292029263257c7ac26e2a144ac8
Reviewed-on: https://chromium-review.googlesource.com/966032
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ASTMetadataHLSL.cpp b/src/compiler/translator/ASTMetadataHLSL.cpp
index 232a958..ecf61a9 100644
--- a/src/compiler/translator/ASTMetadataHLSL.cpp
+++ b/src/compiler/translator/ASTMetadataHLSL.cpp
@@ -9,8 +9,8 @@
#include "compiler/translator/ASTMetadataHLSL.h"
#include "compiler/translator/CallDAG.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/AddAndTrueToLoopCondition.cpp b/src/compiler/translator/AddAndTrueToLoopCondition.cpp
index 27662f1..0cf6821 100644
--- a/src/compiler/translator/AddAndTrueToLoopCondition.cpp
+++ b/src/compiler/translator/AddAndTrueToLoopCondition.cpp
@@ -6,8 +6,8 @@
#include "compiler/translator/AddAndTrueToLoopCondition.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/AddDefaultReturnStatements.cpp b/src/compiler/translator/AddDefaultReturnStatements.cpp
index 4dfe60c..839fd34 100644
--- a/src/compiler/translator/AddDefaultReturnStatements.cpp
+++ b/src/compiler/translator/AddDefaultReturnStatements.cpp
@@ -10,7 +10,7 @@
#include "compiler/translator/AddDefaultReturnStatements.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/ArrayReturnValueToOutParameter.cpp b/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
index 1bde54f..9617fac 100644
--- a/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
+++ b/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
@@ -10,10 +10,10 @@
#include <map>
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp b/src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp
index d6a1e02..19f53a7 100644
--- a/src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp
+++ b/src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp
@@ -10,8 +10,8 @@
#include "BreakVariableAliasingInInnerLoops.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
// A HLSL compiler developer gave us more details on the root cause and the workaround needed:
// The root problem is that if the HLSL compiler is applying aliasing information even on
diff --git a/src/compiler/translator/BuiltInFunctionEmulator.cpp b/src/compiler/translator/BuiltInFunctionEmulator.cpp
index 5e772eb..c1740e8 100644
--- a/src/compiler/translator/BuiltInFunctionEmulator.cpp
+++ b/src/compiler/translator/BuiltInFunctionEmulator.cpp
@@ -6,9 +6,9 @@
#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "angle_gl.h"
-#include "compiler/translator/IntermTraverse.h"
-#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/StaticType.h"
+#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/CallDAG.cpp b/src/compiler/translator/CallDAG.cpp
index 2ca33ea..4e8ed44 100644
--- a/src/compiler/translator/CallDAG.cpp
+++ b/src/compiler/translator/CallDAG.cpp
@@ -11,8 +11,8 @@
#include "compiler/translator/CallDAG.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ClampFragDepth.cpp b/src/compiler/translator/ClampFragDepth.cpp
index 34660ad..e76f7fd 100644
--- a/src/compiler/translator/ClampFragDepth.cpp
+++ b/src/compiler/translator/ClampFragDepth.cpp
@@ -10,12 +10,12 @@
#include "compiler/translator/ClampFragDepth.h"
-#include "compiler/translator/BuiltIn_autogen.h"
-#include "compiler/translator/FindSymbolNode.h"
#include "compiler/translator/ImmutableString.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/RunAtTheEndOfShader.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/BuiltIn_autogen.h"
+#include "compiler/translator/tree_util/FindSymbolNode.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
namespace sh
{
diff --git a/src/compiler/translator/ClampPointSize.cpp b/src/compiler/translator/ClampPointSize.cpp
index a1da108..c97fed4 100644
--- a/src/compiler/translator/ClampPointSize.cpp
+++ b/src/compiler/translator/ClampPointSize.cpp
@@ -8,11 +8,11 @@
#include "compiler/translator/ClampPointSize.h"
-#include "compiler/translator/BuiltIn_autogen.h"
-#include "compiler/translator/FindSymbolNode.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/RunAtTheEndOfShader.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/BuiltIn_autogen.h"
+#include "compiler/translator/tree_util/FindSymbolNode.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
namespace sh
{
diff --git a/src/compiler/translator/CollectVariables.cpp b/src/compiler/translator/CollectVariables.cpp
index 12388e6..de53c72 100644
--- a/src/compiler/translator/CollectVariables.cpp
+++ b/src/compiler/translator/CollectVariables.cpp
@@ -10,8 +10,8 @@
#include "angle_gl.h"
#include "common/utilities.h"
#include "compiler/translator/HashNames.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 8a352c1..f6b170c 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -22,7 +22,6 @@
#include "compiler/translator/FoldExpressions.h"
#include "compiler/translator/Initialize.h"
#include "compiler/translator/InitializeVariables.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
#include "compiler/translator/IsASTDepthBelowLimit.h"
#include "compiler/translator/OutputTree.h"
#include "compiler/translator/ParseContext.h"
@@ -46,6 +45,7 @@
#include "compiler/translator/ValidateVaryingLocations.h"
#include "compiler/translator/VariablePacker.h"
#include "compiler/translator/VectorizeVectorScalarArithmetic.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
#include "compiler/translator/util.h"
#include "third_party/compiler/ArrayBoundsClamper.h"
diff --git a/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp b/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
index 30d1380..2655bc8 100644
--- a/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
+++ b/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
@@ -9,14 +9,14 @@
#include "compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h"
-#include "compiler/translator/BuiltIn_autogen.h"
-#include "compiler/translator/FindMain.h"
#include "compiler/translator/InitializeVariables.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/ReplaceVariable.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/BuiltIn_autogen.h"
+#include "compiler/translator/tree_util/FindMain.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/DeferGlobalInitializers.cpp b/src/compiler/translator/DeferGlobalInitializers.cpp
index 0e14054..ef74585 100644
--- a/src/compiler/translator/DeferGlobalInitializers.cpp
+++ b/src/compiler/translator/DeferGlobalInitializers.cpp
@@ -17,13 +17,13 @@
#include <vector>
-#include "compiler/translator/FindMain.h"
#include "compiler/translator/InitializeVariables.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/ReplaceVariable.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/FindMain.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
namespace sh
{
diff --git a/src/compiler/translator/EmulateGLFragColorBroadcast.cpp b/src/compiler/translator/EmulateGLFragColorBroadcast.cpp
index 7689f04..08cc11b 100644
--- a/src/compiler/translator/EmulateGLFragColorBroadcast.cpp
+++ b/src/compiler/translator/EmulateGLFragColorBroadcast.cpp
@@ -13,10 +13,10 @@
#include "compiler/translator/EmulateGLFragColorBroadcast.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
-#include "compiler/translator/RunAtTheEndOfShader.h"
#include "compiler/translator/Symbol.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
+#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
namespace sh
{
diff --git a/src/compiler/translator/EmulatePrecision.h b/src/compiler/translator/EmulatePrecision.h
index e974131..cbfd035 100644
--- a/src/compiler/translator/EmulatePrecision.h
+++ b/src/compiler/translator/EmulatePrecision.h
@@ -11,7 +11,7 @@
#include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
// This class gathers all compound assignments from the AST and can then write
// the functions required for their precision emulation. This way there is no
diff --git a/src/compiler/translator/ExpandIntegerPowExpressions.cpp b/src/compiler/translator/ExpandIntegerPowExpressions.cpp
index 5015682..b219971 100644
--- a/src/compiler/translator/ExpandIntegerPowExpressions.cpp
+++ b/src/compiler/translator/ExpandIntegerPowExpressions.cpp
@@ -11,8 +11,8 @@
#include <cmath>
#include <cstdlib>
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ExtensionGLSL.h b/src/compiler/translator/ExtensionGLSL.h
index a1b9cb2..9d752c4 100644
--- a/src/compiler/translator/ExtensionGLSL.h
+++ b/src/compiler/translator/ExtensionGLSL.h
@@ -12,7 +12,7 @@
#include <set>
#include <string>
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/FlagStd140Structs.cpp b/src/compiler/translator/FlagStd140Structs.cpp
index 886de30..368854f 100644
--- a/src/compiler/translator/FlagStd140Structs.cpp
+++ b/src/compiler/translator/FlagStd140Structs.cpp
@@ -8,8 +8,8 @@
#include "compiler/translator/FlagStd140Structs.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/FoldExpressions.cpp b/src/compiler/translator/FoldExpressions.cpp
index 71e04d0..231f6d1 100644
--- a/src/compiler/translator/FoldExpressions.cpp
+++ b/src/compiler/translator/FoldExpressions.cpp
@@ -14,7 +14,7 @@
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/InitializeVariables.cpp b/src/compiler/translator/InitializeVariables.cpp
index 97cf5a0..6914f02 100644
--- a/src/compiler/translator/InitializeVariables.cpp
+++ b/src/compiler/translator/InitializeVariables.cpp
@@ -8,11 +8,11 @@
#include "angle_gl.h"
#include "common/debug.h"
-#include "compiler/translator/FindMain.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/FindMain.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/IsASTDepthBelowLimit.cpp b/src/compiler/translator/IsASTDepthBelowLimit.cpp
index aaad4f3..756c194 100644
--- a/src/compiler/translator/IsASTDepthBelowLimit.cpp
+++ b/src/compiler/translator/IsASTDepthBelowLimit.cpp
@@ -6,7 +6,7 @@
#include "compiler/translator/IsASTDepthBelowLimit.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/OutputGLSLBase.h b/src/compiler/translator/OutputGLSLBase.h
index 79c21a3..b1be0ee 100644
--- a/src/compiler/translator/OutputGLSLBase.h
+++ b/src/compiler/translator/OutputGLSLBase.h
@@ -11,7 +11,7 @@
#include "compiler/translator/HashNames.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 31f1a80..df0b3fa 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -15,10 +15,8 @@
#include "common/utilities.h"
#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/BuiltInFunctionEmulatorHLSL.h"
-#include "compiler/translator/FindSymbolNode.h"
#include "compiler/translator/ImageFunctionHLSL.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/NodeSearch.h"
#include "compiler/translator/RemoveSwitchFallThrough.h"
#include "compiler/translator/StructureHLSL.h"
#include "compiler/translator/TextureFunctionHLSL.h"
@@ -26,6 +24,8 @@
#include "compiler/translator/UniformHLSL.h"
#include "compiler/translator/UtilsHLSL.h"
#include "compiler/translator/blocklayout.h"
+#include "compiler/translator/tree_util/FindSymbolNode.h"
+#include "compiler/translator/tree_util/NodeSearch.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/OutputHLSL.h b/src/compiler/translator/OutputHLSL.h
index f749703..c1d6adb 100644
--- a/src/compiler/translator/OutputHLSL.h
+++ b/src/compiler/translator/OutputHLSL.h
@@ -16,7 +16,7 @@
#include "compiler/translator/Compiler.h"
#include "compiler/translator/FlagStd140Structs.h"
#include "compiler/translator/ImmutableString.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
class BuiltInFunctionEmulator;
diff --git a/src/compiler/translator/OutputTree.cpp b/src/compiler/translator/OutputTree.cpp
index 00b40b1..8d2c127 100644
--- a/src/compiler/translator/OutputTree.cpp
+++ b/src/compiler/translator/OutputTree.cpp
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index 0a01022..f0f9380 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -11,14 +11,13 @@
#include "common/mathutil.h"
#include "compiler/preprocessor/SourceLocation.h"
-#include "compiler/translator/BuiltIn_autogen.h"
#include "compiler/translator/Declarator.h"
-#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/ParseContext_autogen.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/ValidateGlobalInitializer.h"
#include "compiler/translator/ValidateSwitch.h"
#include "compiler/translator/glslang.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/PruneEmptyCases.cpp b/src/compiler/translator/PruneEmptyCases.cpp
index e6fd389..a5fb007 100644
--- a/src/compiler/translator/PruneEmptyCases.cpp
+++ b/src/compiler/translator/PruneEmptyCases.cpp
@@ -8,8 +8,8 @@
#include "compiler/translator/PruneEmptyCases.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/Symbol.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/PruneNoOps.cpp b/src/compiler/translator/PruneNoOps.cpp
index ebba6fa..8b2613a 100644
--- a/src/compiler/translator/PruneNoOps.cpp
+++ b/src/compiler/translator/PruneNoOps.cpp
@@ -13,8 +13,8 @@
#include "compiler/translator/PruneNoOps.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/Symbol.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RecordConstantPrecision.cpp b/src/compiler/translator/RecordConstantPrecision.cpp
index 19b93e3..71afbda 100644
--- a/src/compiler/translator/RecordConstantPrecision.cpp
+++ b/src/compiler/translator/RecordConstantPrecision.cpp
@@ -17,8 +17,8 @@
#include "compiler/translator/RecordConstantPrecision.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RegenerateStructNames.h b/src/compiler/translator/RegenerateStructNames.h
index cce9bc0..2be465b 100644
--- a/src/compiler/translator/RegenerateStructNames.h
+++ b/src/compiler/translator/RegenerateStructNames.h
@@ -7,8 +7,8 @@
#ifndef COMPILER_TRANSLATOR_REGENERATESTRUCTNAMES_H_
#define COMPILER_TRANSLATOR_REGENERATESTRUCTNAMES_H_
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include <set>
diff --git a/src/compiler/translator/RemoveArrayLengthMethod.cpp b/src/compiler/translator/RemoveArrayLengthMethod.cpp
index e9e6a17..02d7f35 100644
--- a/src/compiler/translator/RemoveArrayLengthMethod.cpp
+++ b/src/compiler/translator/RemoveArrayLengthMethod.cpp
@@ -22,7 +22,7 @@
#include "compiler/translator/RemoveArrayLengthMethod.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RemoveDynamicIndexing.cpp b/src/compiler/translator/RemoveDynamicIndexing.cpp
index 1357676..00fec22 100644
--- a/src/compiler/translator/RemoveDynamicIndexing.cpp
+++ b/src/compiler/translator/RemoveDynamicIndexing.cpp
@@ -11,11 +11,11 @@
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RemoveInvariantDeclaration.cpp b/src/compiler/translator/RemoveInvariantDeclaration.cpp
index 4b533dc..6a026c8 100644
--- a/src/compiler/translator/RemoveInvariantDeclaration.cpp
+++ b/src/compiler/translator/RemoveInvariantDeclaration.cpp
@@ -6,7 +6,7 @@
#include "compiler/translator/RemoveInvariantDeclaration.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RemovePow.cpp b/src/compiler/translator/RemovePow.cpp
index b2cdac5..c5cab90 100644
--- a/src/compiler/translator/RemovePow.cpp
+++ b/src/compiler/translator/RemovePow.cpp
@@ -11,7 +11,7 @@
#include "compiler/translator/RemovePow.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RemoveSwitchFallThrough.cpp b/src/compiler/translator/RemoveSwitchFallThrough.cpp
index dea949f..9ac55e9 100644
--- a/src/compiler/translator/RemoveSwitchFallThrough.cpp
+++ b/src/compiler/translator/RemoveSwitchFallThrough.cpp
@@ -11,7 +11,7 @@
#include "compiler/translator/RemoveSwitchFallThrough.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RemoveUnreferencedVariables.cpp b/src/compiler/translator/RemoveUnreferencedVariables.cpp
index b76648f..3ba66c5 100644
--- a/src/compiler/translator/RemoveUnreferencedVariables.cpp
+++ b/src/compiler/translator/RemoveUnreferencedVariables.cpp
@@ -10,8 +10,8 @@
#include "compiler/translator/RemoveUnreferencedVariables.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ReplaceVariable.cpp b/src/compiler/translator/ReplaceVariable.cpp
index 98667db..66ad646 100644
--- a/src/compiler/translator/ReplaceVariable.cpp
+++ b/src/compiler/translator/ReplaceVariable.cpp
@@ -9,7 +9,7 @@
#include "compiler/translator/ReplaceVariable.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RewriteDoWhile.cpp b/src/compiler/translator/RewriteDoWhile.cpp
index aab608f..4a0f542 100644
--- a/src/compiler/translator/RewriteDoWhile.cpp
+++ b/src/compiler/translator/RewriteDoWhile.cpp
@@ -9,9 +9,9 @@
#include "compiler/translator/RewriteDoWhile.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RewriteElseBlocks.cpp b/src/compiler/translator/RewriteElseBlocks.cpp
index a4e22cf..489cc9d 100644
--- a/src/compiler/translator/RewriteElseBlocks.cpp
+++ b/src/compiler/translator/RewriteElseBlocks.cpp
@@ -10,9 +10,9 @@
#include "compiler/translator/RewriteElseBlocks.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/NodeSearch.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/NodeSearch.h"
namespace sh
{
diff --git a/src/compiler/translator/RewriteTexelFetchOffset.cpp b/src/compiler/translator/RewriteTexelFetchOffset.cpp
index b93d9a1..a0892c3 100644
--- a/src/compiler/translator/RewriteTexelFetchOffset.cpp
+++ b/src/compiler/translator/RewriteTexelFetchOffset.cpp
@@ -9,9 +9,9 @@
#include "compiler/translator/RewriteTexelFetchOffset.h"
#include "common/angleutils.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RewriteUnaryMinusOperatorFloat.cpp b/src/compiler/translator/RewriteUnaryMinusOperatorFloat.cpp
index 696a495..fe7bf94 100644
--- a/src/compiler/translator/RewriteUnaryMinusOperatorFloat.cpp
+++ b/src/compiler/translator/RewriteUnaryMinusOperatorFloat.cpp
@@ -6,8 +6,8 @@
#include "compiler/translator/RewriteUnaryMinusOperatorFloat.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp b/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
index 7b2fdf2..069214c 100644
--- a/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
+++ b/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
@@ -8,7 +8,7 @@
#include "compiler/translator/RewriteUnaryMinusOperatorInt.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp b/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp
index 21edb70..7a9648c 100644
--- a/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp
+++ b/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp
@@ -15,9 +15,9 @@
#include "angle_gl.h"
#include "common/angleutils.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SeparateArrayConstructorStatements.cpp b/src/compiler/translator/SeparateArrayConstructorStatements.cpp
index a98b727..0aaa6cc 100644
--- a/src/compiler/translator/SeparateArrayConstructorStatements.cpp
+++ b/src/compiler/translator/SeparateArrayConstructorStatements.cpp
@@ -11,7 +11,7 @@
#include "compiler/translator/SeparateArrayConstructorStatements.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SeparateDeclarations.cpp b/src/compiler/translator/SeparateDeclarations.cpp
index 9a06607..30713c6 100644
--- a/src/compiler/translator/SeparateDeclarations.cpp
+++ b/src/compiler/translator/SeparateDeclarations.cpp
@@ -15,7 +15,7 @@
#include "compiler/translator/SeparateDeclarations.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SeparateExpressionsReturningArrays.cpp b/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
index 4f78a4a..30124e6 100644
--- a/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
+++ b/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
@@ -11,9 +11,9 @@
#include "compiler/translator/SeparateExpressionsReturningArrays.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SimplifyLoopConditions.cpp b/src/compiler/translator/SimplifyLoopConditions.cpp
index 37d7b0e..acbb50c 100644
--- a/src/compiler/translator/SimplifyLoopConditions.cpp
+++ b/src/compiler/translator/SimplifyLoopConditions.cpp
@@ -10,10 +10,10 @@
#include "compiler/translator/SimplifyLoopConditions.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SplitSequenceOperator.cpp b/src/compiler/translator/SplitSequenceOperator.cpp
index 62da2ac..c35e73c 100644
--- a/src/compiler/translator/SplitSequenceOperator.cpp
+++ b/src/compiler/translator/SplitSequenceOperator.cpp
@@ -11,8 +11,8 @@
#include "compiler/translator/SplitSequenceOperator.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/SymbolTable.cpp b/src/compiler/translator/SymbolTable.cpp
index b323fa5..efc1d8d 100644
--- a/src/compiler/translator/SymbolTable.cpp
+++ b/src/compiler/translator/SymbolTable.cpp
@@ -17,7 +17,6 @@
#include <set>
#include "angle_gl.h"
-#include "compiler/translator/BuiltIn_autogen.h"
#include "compiler/translator/ImmutableString.h"
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/StaticType.h"
diff --git a/src/compiler/translator/TranslatorHLSL.cpp b/src/compiler/translator/TranslatorHLSL.cpp
index 9327b3a..a5b5b58 100644
--- a/src/compiler/translator/TranslatorHLSL.cpp
+++ b/src/compiler/translator/TranslatorHLSL.cpp
@@ -11,7 +11,6 @@
#include "compiler/translator/BreakVariableAliasingInInnerLoops.h"
#include "compiler/translator/EmulatePrecision.h"
#include "compiler/translator/ExpandIntegerPowExpressions.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
#include "compiler/translator/OutputHLSL.h"
#include "compiler/translator/PruneEmptyCases.h"
#include "compiler/translator/RemoveDynamicIndexing.h"
@@ -26,6 +25,7 @@
#include "compiler/translator/SplitSequenceOperator.h"
#include "compiler/translator/UnfoldShortCircuitToIf.h"
#include "compiler/translator/WrapSwitchStatementsInBlocks.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
namespace sh
{
diff --git a/src/compiler/translator/TranslatorVulkan.cpp b/src/compiler/translator/TranslatorVulkan.cpp
index ac24dc5..3ab7e71 100644
--- a/src/compiler/translator/TranslatorVulkan.cpp
+++ b/src/compiler/translator/TranslatorVulkan.cpp
@@ -13,11 +13,11 @@
#include "angle_gl.h"
#include "common/utilities.h"
-#include "compiler/translator/BuiltIn_autogen.h"
-#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/OutputVulkanGLSL.h"
-#include "compiler/translator/RunAtTheEndOfShader.h"
#include "compiler/translator/StaticType.h"
+#include "compiler/translator/tree_util/BuiltIn_autogen.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/UnfoldShortCircuitAST.cpp b/src/compiler/translator/UnfoldShortCircuitAST.cpp
index 3108bfe..4fb643a 100644
--- a/src/compiler/translator/UnfoldShortCircuitAST.cpp
+++ b/src/compiler/translator/UnfoldShortCircuitAST.cpp
@@ -7,8 +7,8 @@
#include "compiler/translator/UnfoldShortCircuitAST.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/UnfoldShortCircuitToIf.cpp b/src/compiler/translator/UnfoldShortCircuitToIf.cpp
index c8c56de..3c6d81a 100644
--- a/src/compiler/translator/UnfoldShortCircuitToIf.cpp
+++ b/src/compiler/translator/UnfoldShortCircuitToIf.cpp
@@ -11,10 +11,10 @@
#include "compiler/translator/UnfoldShortCircuitToIf.h"
-#include "compiler/translator/IntermNodePatternMatcher.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/UseInterfaceBlockFields.cpp b/src/compiler/translator/UseInterfaceBlockFields.cpp
index 900119d..eee1117 100644
--- a/src/compiler/translator/UseInterfaceBlockFields.cpp
+++ b/src/compiler/translator/UseInterfaceBlockFields.cpp
@@ -10,10 +10,10 @@
#include "compiler/translator/UseInterfaceBlockFields.h"
-#include "compiler/translator/FindMain.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/FindMain.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/ValidateGlobalInitializer.cpp b/src/compiler/translator/ValidateGlobalInitializer.cpp
index 6c65fa2..6d79bbf 100644
--- a/src/compiler/translator/ValidateGlobalInitializer.cpp
+++ b/src/compiler/translator/ValidateGlobalInitializer.cpp
@@ -6,7 +6,7 @@
#include "compiler/translator/ValidateGlobalInitializer.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ValidateLimitations.cpp b/src/compiler/translator/ValidateLimitations.cpp
index b9fd73e..0fb8fe3 100644
--- a/src/compiler/translator/ValidateLimitations.cpp
+++ b/src/compiler/translator/ValidateLimitations.cpp
@@ -8,8 +8,8 @@
#include "angle_gl.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/ParseContext.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ValidateOutputs.cpp b/src/compiler/translator/ValidateOutputs.cpp
index d77a0da..6399c6b 100644
--- a/src/compiler/translator/ValidateOutputs.cpp
+++ b/src/compiler/translator/ValidateOutputs.cpp
@@ -12,8 +12,8 @@
#include <set>
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/ParseContext.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ValidateSwitch.cpp b/src/compiler/translator/ValidateSwitch.cpp
index 0e35128..096ea6d 100644
--- a/src/compiler/translator/ValidateSwitch.cpp
+++ b/src/compiler/translator/ValidateSwitch.cpp
@@ -7,7 +7,7 @@
#include "compiler/translator/ValidateSwitch.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/ValidateVaryingLocations.cpp b/src/compiler/translator/ValidateVaryingLocations.cpp
index 728059d..bee43cf 100644
--- a/src/compiler/translator/ValidateVaryingLocations.cpp
+++ b/src/compiler/translator/ValidateVaryingLocations.cpp
@@ -10,8 +10,8 @@
#include "ValidateVaryingLocations.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
diff --git a/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp b/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp
index 75b1228..20ba15a 100644
--- a/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp
+++ b/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp
@@ -14,8 +14,8 @@
#include <set>
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/VersionGLSL.h b/src/compiler/translator/VersionGLSL.h
index b9197ba..f05da96 100644
--- a/src/compiler/translator/VersionGLSL.h
+++ b/src/compiler/translator/VersionGLSL.h
@@ -7,7 +7,7 @@
#ifndef COMPILER_TRANSLATOR_VERSIONGLSL_H_
#define COMPILER_TRANSLATOR_VERSIONGLSL_H_
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/Pragma.h"
diff --git a/src/compiler/translator/WrapSwitchStatementsInBlocks.cpp b/src/compiler/translator/WrapSwitchStatementsInBlocks.cpp
index badca96..6397cb5 100644
--- a/src/compiler/translator/WrapSwitchStatementsInBlocks.cpp
+++ b/src/compiler/translator/WrapSwitchStatementsInBlocks.cpp
@@ -29,7 +29,7 @@
#include "compiler/translator/WrapSwitchStatementsInBlocks.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/gen_builtin_symbols.py b/src/compiler/translator/gen_builtin_symbols.py
index b9daa2d..17ad9ae 100644
--- a/src/compiler/translator/gen_builtin_symbols.py
+++ b/src/compiler/translator/gen_builtin_symbols.py
@@ -60,8 +60,8 @@
// BuiltIn_autogen.h:
// Compile-time initialized built-ins.
-#ifndef COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
-#define COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
namespace sh
{{
@@ -77,7 +77,7 @@
}} // namespace sh
-#endif // COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
+#endif // COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
"""
template_symboltable_h = """// GENERATED FILE - DO NOT EDIT.
@@ -1141,7 +1141,7 @@
output_cpp = template_immutablestringtest_cpp.format(**output_strings)
outfile_cpp.write(output_cpp)
-with open('BuiltIn_autogen.h', 'wt') as outfile_header:
+with open('tree_util/BuiltIn_autogen.h', 'wt') as outfile_header:
output_header = template_builtin_header.format(**output_strings)
outfile_header.write(output_header)
diff --git a/src/compiler/translator/BuiltIn_autogen.h b/src/compiler/translator/tree_util/BuiltIn_autogen.h
similarity index 89%
rename from src/compiler/translator/BuiltIn_autogen.h
rename to src/compiler/translator/tree_util/BuiltIn_autogen.h
index b70ec80..e301df9 100644
--- a/src/compiler/translator/BuiltIn_autogen.h
+++ b/src/compiler/translator/tree_util/BuiltIn_autogen.h
@@ -9,8 +9,8 @@
// BuiltIn_autogen.h:
// Compile-time initialized built-ins.
-#ifndef COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
-#define COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
namespace sh
{
@@ -53,4 +53,4 @@
} // namespace sh
-#endif // COMPILER_TRANSLATOR_BUILTIN_AUTOGEN_H_
+#endif // COMPILER_TRANSLATOR_TREEUTIL_BUILTIN_AUTOGEN_H_
diff --git a/src/compiler/translator/FindMain.cpp b/src/compiler/translator/tree_util/FindMain.cpp
similarity index 94%
rename from src/compiler/translator/FindMain.cpp
rename to src/compiler/translator/tree_util/FindMain.cpp
index 091e21a..9823a01 100644
--- a/src/compiler/translator/FindMain.cpp
+++ b/src/compiler/translator/tree_util/FindMain.cpp
@@ -6,7 +6,7 @@
// FindMain.cpp: Find the main() function definition in a given AST.
-#include "compiler/translator/FindMain.h"
+#include "compiler/translator/tree_util/FindMain.h"
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/Symbol.h"
diff --git a/src/compiler/translator/FindMain.h b/src/compiler/translator/tree_util/FindMain.h
similarity index 75%
rename from src/compiler/translator/FindMain.h
rename to src/compiler/translator/tree_util/FindMain.h
index bf2c45d..f619e6e 100644
--- a/src/compiler/translator/FindMain.h
+++ b/src/compiler/translator/tree_util/FindMain.h
@@ -6,8 +6,8 @@
// FindMain.h: Adds functions to get the main function definition and its body.
-#ifndef COMPILER_TRANSLATOR_FINDMAIN_H_
-#define COMPILER_TRANSLATOR_FINDMAIN_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_
namespace sh
{
@@ -20,4 +20,4 @@
} // namespace sh
-#endif // COMPILER_TRANSLATOR_FINDMAIN_H_
\ No newline at end of file
+#endif // COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_
\ No newline at end of file
diff --git a/src/compiler/translator/FindSymbolNode.cpp b/src/compiler/translator/tree_util/FindSymbolNode.cpp
similarity index 91%
rename from src/compiler/translator/FindSymbolNode.cpp
rename to src/compiler/translator/tree_util/FindSymbolNode.cpp
index f63acf5..97318ef 100644
--- a/src/compiler/translator/FindSymbolNode.cpp
+++ b/src/compiler/translator/tree_util/FindSymbolNode.cpp
@@ -6,11 +6,11 @@
// FindSymbol.cpp:
// Utility for finding a symbol node inside an AST tree.
-#include "compiler/translator/FindSymbolNode.h"
+#include "compiler/translator/tree_util/FindSymbolNode.h"
#include "compiler/translator/ImmutableString.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/Symbol.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
diff --git a/src/compiler/translator/FindSymbolNode.h b/src/compiler/translator/tree_util/FindSymbolNode.h
similarity index 73%
rename from src/compiler/translator/FindSymbolNode.h
rename to src/compiler/translator/tree_util/FindSymbolNode.h
index 0e6f8cb..f285479 100644
--- a/src/compiler/translator/FindSymbolNode.h
+++ b/src/compiler/translator/tree_util/FindSymbolNode.h
@@ -6,8 +6,8 @@
// FindSymbolNode.h:
// Utility for finding a symbol node inside an AST tree.
-#ifndef COMPILER_TRANSLATOR_FIND_SYMBOL_H_
-#define COMPILER_TRANSLATOR_FIND_SYMBOL_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_FINDSYMBOLNODE_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_FINDSYMBOLNODE_H_
namespace sh
{
@@ -20,4 +20,4 @@
} // namespace sh
-#endif // COMPILER_TRANSLATOR_FIND_SYMBOL_H_
\ No newline at end of file
+#endif // COMPILER_TRANSLATOR_TREEUTIL_FINDSYMBOLNODE_H_
\ No newline at end of file
diff --git a/src/compiler/translator/IntermNodePatternMatcher.cpp b/src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp
similarity index 98%
rename from src/compiler/translator/IntermNodePatternMatcher.cpp
rename to src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp
index 80180fb..752b9e2 100644
--- a/src/compiler/translator/IntermNodePatternMatcher.cpp
+++ b/src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp
@@ -8,7 +8,7 @@
// traversers.
//
-#include "compiler/translator/IntermNodePatternMatcher.h"
+#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/SymbolTable.h"
diff --git a/src/compiler/translator/IntermNodePatternMatcher.h b/src/compiler/translator/tree_util/IntermNodePatternMatcher.h
similarity index 92%
rename from src/compiler/translator/IntermNodePatternMatcher.h
rename to src/compiler/translator/tree_util/IntermNodePatternMatcher.h
index b83ec67..1e7db4e 100644
--- a/src/compiler/translator/IntermNodePatternMatcher.h
+++ b/src/compiler/translator/tree_util/IntermNodePatternMatcher.h
@@ -8,8 +8,8 @@
// traversers.
//
-#ifndef COMPILER_TRANSLATOR_INTERMNODEPATTERNMATCHER_H_
-#define COMPILER_TRANSLATOR_INTERMNODEPATTERNMATCHER_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_INTERMNODEPATTERNMATCHER_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_INTERMNODEPATTERNMATCHER_H_
namespace sh
{
@@ -76,4 +76,4 @@
} // namespace sh
-#endif
+#endif // COMPILER_TRANSLATOR_TREEUTIL_INTERMNODEPATTERNMATCHER_H_
diff --git a/src/compiler/translator/IntermNode_util.cpp b/src/compiler/translator/tree_util/IntermNode_util.cpp
similarity index 98%
rename from src/compiler/translator/IntermNode_util.cpp
rename to src/compiler/translator/tree_util/IntermNode_util.cpp
index 898ae2c..39d2eab 100644
--- a/src/compiler/translator/IntermNode_util.cpp
+++ b/src/compiler/translator/tree_util/IntermNode_util.cpp
@@ -6,7 +6,7 @@
// IntermNode_util.cpp: High-level utilities for creating AST nodes and node hierarchies. Mostly
// meant to be used in AST transforms.
-#include "compiler/translator/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/FunctionLookup.h"
#include "compiler/translator/SymbolTable.h"
@@ -216,7 +216,7 @@
{
TVariable *variable =
CreateTempVariable(symbolTable, new TType(initializer->getType()), qualifier);
- *declarationOut = CreateTempInitDeclarationNode(variable, initializer);
+ *declarationOut = CreateTempInitDeclarationNode(variable, initializer);
return variable;
}
diff --git a/src/compiler/translator/IntermNode_util.h b/src/compiler/translator/tree_util/IntermNode_util.h
similarity index 100%
rename from src/compiler/translator/IntermNode_util.h
rename to src/compiler/translator/tree_util/IntermNode_util.h
diff --git a/src/compiler/translator/IntermTraverse.cpp b/src/compiler/translator/tree_util/IntermTraverse.cpp
similarity index 99%
rename from src/compiler/translator/IntermTraverse.cpp
rename to src/compiler/translator/tree_util/IntermTraverse.cpp
index dbdfae2..6753f6e 100644
--- a/src/compiler/translator/IntermTraverse.cpp
+++ b/src/compiler/translator/tree_util/IntermTraverse.cpp
@@ -4,11 +4,11 @@
// found in the LICENSE file.
//
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
namespace sh
{
diff --git a/src/compiler/translator/IntermTraverse.h b/src/compiler/translator/tree_util/IntermTraverse.h
similarity index 98%
rename from src/compiler/translator/IntermTraverse.h
rename to src/compiler/translator/tree_util/IntermTraverse.h
index 55ffef5..93f7e69 100644
--- a/src/compiler/translator/IntermTraverse.h
+++ b/src/compiler/translator/tree_util/IntermTraverse.h
@@ -6,8 +6,8 @@
// IntermTraverse.h : base classes for AST traversers that walk the AST and
// also have the ability to transform it by replacing nodes.
-#ifndef COMPILER_TRANSLATOR_INTERMTRAVERSE_H_
-#define COMPILER_TRANSLATOR_INTERMTRAVERSE_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_INTERMTRAVERSE_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_INTERMTRAVERSE_H_
#include "compiler/translator/IntermNode.h"
@@ -314,4 +314,4 @@
} // namespace sh
-#endif // COMPILER_TRANSLATOR_INTERMTRAVERSE_H_
+#endif // COMPILER_TRANSLATOR_TREEUTIL_INTERMTRAVERSE_H_
diff --git a/src/compiler/translator/NodeSearch.h b/src/compiler/translator/tree_util/NodeSearch.h
similarity index 82%
rename from src/compiler/translator/NodeSearch.h
rename to src/compiler/translator/tree_util/NodeSearch.h
index af86b8b..53c800c 100644
--- a/src/compiler/translator/NodeSearch.h
+++ b/src/compiler/translator/tree_util/NodeSearch.h
@@ -6,10 +6,10 @@
// NodeSearch.h: Utilities for searching translator node graphs
//
-#ifndef COMPILER_TRANSLATOR_NODESEARCH_H_
-#define COMPILER_TRANSLATOR_NODESEARCH_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_NODESEARCH_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_NODESEARCH_H_
-#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
@@ -53,4 +53,4 @@
};
}
-#endif // COMPILER_TRANSLATOR_NODESEARCH_H_
+#endif // COMPILER_TRANSLATOR_TREEUTIL_NODESEARCH_H_
diff --git a/src/compiler/translator/RunAtTheEndOfShader.cpp b/src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp
similarity index 91%
rename from src/compiler/translator/RunAtTheEndOfShader.cpp
rename to src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp
index 9a6f8d6..4f6160b 100644
--- a/src/compiler/translator/RunAtTheEndOfShader.cpp
+++ b/src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp
@@ -19,14 +19,14 @@
// This way the code will get run even if the return statement inside main is executed.
//
-#include "compiler/translator/RunAtTheEndOfShader.h"
+#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
-#include "compiler/translator/FindMain.h"
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/IntermNode_util.h"
-#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
+#include "compiler/translator/tree_util/FindMain.h"
+#include "compiler/translator/tree_util/IntermNode_util.h"
+#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
@@ -86,7 +86,7 @@
// main0();
// codeToRun
// }
- TIntermBlock *newMainBody = new TIntermBlock();
+ TIntermBlock *newMainBody = new TIntermBlock();
TIntermAggregate *oldMainCall =
TIntermAggregate::CreateFunctionCall(*oldMain, new TIntermSequence());
newMainBody->appendStatement(oldMainCall);
diff --git a/src/compiler/translator/RunAtTheEndOfShader.h b/src/compiler/translator/tree_util/RunAtTheEndOfShader.h
similarity index 71%
rename from src/compiler/translator/RunAtTheEndOfShader.h
rename to src/compiler/translator/tree_util/RunAtTheEndOfShader.h
index ed94c28..ed5a0bb 100644
--- a/src/compiler/translator/RunAtTheEndOfShader.h
+++ b/src/compiler/translator/tree_util/RunAtTheEndOfShader.h
@@ -6,8 +6,8 @@
// RunAtTheEndOfShader.h: Add code to be run at the end of the shader.
//
-#ifndef COMPILER_TRANSLATOR_RUNATTHEENDOFSHADER_H_
-#define COMPILER_TRANSLATOR_RUNATTHEENDOFSHADER_H_
+#ifndef COMPILER_TRANSLATOR_TREEUTIL_RUNATTHEENDOFSHADER_H_
+#define COMPILER_TRANSLATOR_TREEUTIL_RUNATTHEENDOFSHADER_H_
namespace sh
{
@@ -20,4 +20,4 @@
} // namespace sh
-#endif // COMPILER_TRANSLATOR_RUNATTHEENDOFSHADER_H_
\ No newline at end of file
+#endif // COMPILER_TRANSLATOR_TREEUTIL_RUNATTHEENDOFSHADER_H_
\ No newline at end of file