Map long for-loop control variable names in shaders.
Look at TIntermLoop::traverse() in IntermTraverse.cpp, the control init part is not handled explicitly there (unlike the other two parts). It is expected hat visitLoop will cover the init part. The bug in the MapLongVariableNames is that the visitLoop doesn't do anything. This CL fixes it.
BUG=171
TEST=conformance/glsl-long-variable-names.html passing.
Review URL: http://codereview.appspot.com/4644045
git-svn-id: https://angleproject.googlecode.com/svn/trunk@696 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/MapLongVariableNames.cpp b/src/compiler/MapLongVariableNames.cpp
index 847e6e6..c9b6a12 100644
--- a/src/compiler/MapLongVariableNames.cpp
+++ b/src/compiler/MapLongVariableNames.cpp
@@ -67,13 +67,15 @@
return true;
}
-bool MapLongVariableNames::visitAggregate(Visit, TIntermAggregate* node)
+bool MapLongVariableNames::visitAggregate(Visit, TIntermAggregate*)
{
return true;
}
-bool MapLongVariableNames::visitLoop(Visit, TIntermLoop*)
+bool MapLongVariableNames::visitLoop(Visit, TIntermLoop* node)
{
+ if (node->getInit())
+ node->getInit()->traverse(this);
return true;
}