Replace remaining usage of TName with TSymbol

TName used to contain just a subset of the information stored in
TSymbol. It makes more sense to use TSymbol directly instead of
converting it to TName.

This also improves type safety a bit by making some functions only
take in TVariable or TFunction instead of the more generic TName.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: Icb46923c25d33ebbbbc06ddc487da25957dda771
Reviewed-on: https://chromium-review.googlesource.com/829143
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index b8fd3a4..c00a77b 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -88,7 +88,7 @@
     TIntermSymbol *imageSymbol = imageNode->getAsSymbolNode();
     if (imageSymbol)
     {
-        return imageSymbol->getSymbol().c_str();
+        return imageSymbol->getName().c_str();
     }
     return "image";
 }
@@ -606,7 +606,10 @@
     //
     if (symNode)
     {
-        const char *symbol = symNode->getSymbol().c_str();
+        // Symbol inside an expression can't be nameless.
+        ASSERT(symNode->variable().symbolType() != SymbolType::Empty);
+
+        const char *symbol = symNode->getName().c_str();
         std::stringstream reasonStream;
         reasonStream << "l-value required (" << message << " \"" << symbol << "\")";
         std::string reason = reasonStream.str();
@@ -3928,7 +3931,7 @@
         if (baseExpression->getAsSymbolNode())
         {
             error(location, " left of '[' is not of type array, matrix, or vector ",
-                  baseExpression->getAsSymbolNode()->getSymbol().c_str());
+                  baseExpression->getAsSymbolNode()->getName().c_str());
         }
         else
         {