Remove EOpInternalFunctionCall

It's cleaner to mark internal functions by using the TName class,
similarly to TIntermSymbol.

TEST=angle_unittests
BUG=angleproject:1116

Change-Id: I12a03a3dea42b3fc571fa25a1b11d0161f24de72
Reviewed-on: https://chromium-review.googlesource.com/291621
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 54a1b27..4deeceb 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -783,7 +783,7 @@
                 out << arrayBrackets(type);
         }
 
-        out << " " << hashFunctionName(node->getName());
+        out << " " << hashFunctionNameIfNeeded(node->getNameObj());
 
         out << "(";
         writeFunctionParameters(*(node->getSequence()));
@@ -801,7 +801,7 @@
                 out << arrayBrackets(type);
         }
 
-        out << " " << hashFunctionName(node->getName());
+        out << " " << hashFunctionNameIfNeeded(node->getNameObj());
 
         incrementDepth(node);
         // Function definition node contains one or two children nodes
@@ -830,16 +830,7 @@
       case EOpFunctionCall:
         // Function call.
         if (visit == PreVisit)
-            out << hashFunctionName(node->getName()) << "(";
-        else if (visit == InVisit)
-            out << ", ";
-        else
-            out << ")";
-        break;
-      case EOpInternalFunctionCall:
-        // Function call to an internal helper function.
-        if (visit == PreVisit)
-            out << node->getName() << "(";
+            out << hashFunctionNameIfNeeded(node->getNameObj()) << "(";
         else if (visit == InVisit)
             out << ", ";
         else
@@ -1234,12 +1225,16 @@
     return hashName(name);
 }
 
-TString TOutputGLSLBase::hashFunctionName(const TString &mangled_name)
+TString TOutputGLSLBase::hashFunctionNameIfNeeded(const TName &mangledName)
 {
-    TString name = TFunction::unmangleName(mangled_name);
-    if (mSymbolTable.findBuiltIn(mangled_name, mShaderVersion) != NULL || name == "main")
+    TString mangledStr = mangledName.getString();
+    TString name = TFunction::unmangleName(mangledStr);
+    if (mSymbolTable.findBuiltIn(mangledStr, mShaderVersion) != nullptr || name == "main")
         return translateTextureFunction(name);
-    return hashName(name);
+    if (mangledName.isInternal())
+        return name;
+    else
+        return hashName(name);
 }
 
 bool TOutputGLSLBase::structDeclared(const TStructure *structure) const