Expose the IntermNode tree generated in the compiler for testing
This refactoring makes it possible for tests to access the IntermNode
tree produced by compilation by calling compileTree(). Removing
ParseContext usage from OutputHLSL has the additional benefit of better
separation between parsing and output.
BUG=angle:916
Change-Id: Ib40954832316328772a5c1dcbbe6b46b238e4e65
Reviewed-on: https://chromium-review.googlesource.com/249723
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/intermOut.cpp b/src/compiler/translator/intermOut.cpp
index 44a5c03..3d6a15a 100644
--- a/src/compiler/translator/intermOut.cpp
+++ b/src/compiler/translator/intermOut.cpp
@@ -613,14 +613,13 @@
//
// This function is the one to call externally to start the traversal.
// Individual functions can be initialized to 0 to skip processing of that
-// type of node. It's children will still be processed.
+// type of node. Its children will still be processed.
//
-void TIntermediate::outputTree(TIntermNode *root)
+void TIntermediate::outputTree(TIntermNode *root, TInfoSinkBase &infoSink)
{
- if (root == NULL)
- return;
+ TOutputTraverser it(infoSink);
- TOutputTraverser it(mInfoSink.info);
+ ASSERT(root);
root->traverse(&it);
}