Commit 19b932a6 by Zhenyao Mo

Fix a traverse bug.

In loop node, the init part was skipped in traversing. BUG= TEST= R=kbr@chromium.org Review URL: https://codereview.appspot.com/14366043
parent 2c315f12
......@@ -211,9 +211,15 @@ void TIntermLoop::traverse(TIntermTraverser *it)
if (cond)
cond->traverse(it);
if (init)
init->traverse(it);
}
else
{
if (init)
init->traverse(it);
if (cond)
cond->traverse(it);
......
......@@ -102,13 +102,6 @@ void MapLongVariableNames::visitSymbol(TIntermSymbol* symbol)
}
}
bool MapLongVariableNames::visitLoop(Visit, TIntermLoop* node)
{
if (node->getInit())
node->getInit()->traverse(this);
return true;
}
TString MapLongVariableNames::mapGlobalLongName(const TString& name)
{
ASSERT(mGlobalMap);
......
......@@ -48,7 +48,6 @@ public:
MapLongVariableNames(LongNameMap* globalMap);
virtual void visitSymbol(TIntermSymbol*);
virtual bool visitLoop(Visit, TIntermLoop*);
private:
TString mapGlobalLongName(const TString& name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment