translator: remove code related to for-loop unrolling

For loop unrolling is not used and causes the translator fuzzer to find
a hang when unrolling tons of nested loops (duh).
Also remove MMap.h which was unused.

This is essentially a revert of https://codereview.appspot.com/4331048

BUG=chromium:665255

Change-Id: Id6940f7e306d4ed53bc992f751e9ffe733190f17
Reviewed-on: https://chromium-review.googlesource.com/412023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 2c32b2e..6860edc 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -376,10 +376,7 @@
 void TOutputGLSLBase::visitSymbol(TIntermSymbol *node)
 {
     TInfoSinkBase &out = objSink();
-    if (mLoopUnrollStack.needsToReplaceSymbolWithValue(node))
-        out << mLoopUnrollStack.getLoopIndexValue(node);
-    else
-        out << hashVariableName(node->getName());
+    out << hashVariableName(node->getName());
 
     if (mDeclaringVariables && node->getType().isArray())
         out << arrayBrackets(node->getType());
@@ -1124,49 +1121,22 @@
 
     TLoopType loopType = node->getType();
 
-    // Only for loops can be unrolled
-    ASSERT(!node->getUnrollFlag() || loopType == ELoopFor);
-
     if (loopType == ELoopFor)  // for loop
     {
-        if (!node->getUnrollFlag())
-        {
-            out << "for (";
-            if (node->getInit())
-                node->getInit()->traverse(this);
-            out << "; ";
+        out << "for (";
+        if (node->getInit())
+            node->getInit()->traverse(this);
+        out << "; ";
 
-            if (node->getCondition())
-                node->getCondition()->traverse(this);
-            out << "; ";
+        if (node->getCondition())
+            node->getCondition()->traverse(this);
+        out << "; ";
 
-            if (node->getExpression())
-                node->getExpression()->traverse(this);
-            out << ")\n";
+        if (node->getExpression())
+            node->getExpression()->traverse(this);
+        out << ")\n";
 
-            visitCodeBlock(node->getBody());
-        }
-        else
-        {
-            // Need to put a one-iteration loop here to handle break.
-            TIntermSequence *declSeq = node->getInit()->getAsDeclarationNode()->getSequence();
-            TIntermSymbol *indexSymbol =
-                (*declSeq)[0]->getAsBinaryNode()->getLeft()->getAsSymbolNode();
-            TString name = hashVariableName(indexSymbol->getName());
-            out << "for (int " << name << " = 0; "
-                << name << " < 1; "
-                << "++" << name << ")\n";
-
-            out << "{\n";
-            mLoopUnrollStack.push(node);
-            while (mLoopUnrollStack.satisfiesLoopCondition())
-            {
-                visitCodeBlock(node->getBody());
-                mLoopUnrollStack.step();
-            }
-            mLoopUnrollStack.pop();
-            out << "}\n";
-        }
+        visitCodeBlock(node->getBody());
     }
     else if (loopType == ELoopWhile)  // while loop
     {