Make TVariable type immutable

This enables using constexpr types for built-in variables and some of
the variables created in AST transformations.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: Ie85b3c9872a071a7c023ced013b14ad91cff7cee
Reviewed-on: https://chromium-review.googlesource.com/868134
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Symbol.cpp b/src/compiler/translator/Symbol.cpp
index 4301a5b..a16ffcd 100644
--- a/src/compiler/translator/Symbol.cpp
+++ b/src/compiler/translator/Symbol.cpp
@@ -59,11 +59,12 @@
 
 TVariable::TVariable(TSymbolTable *symbolTable,
                      const TString *name,
-                     const TType &t,
+                     const TType *type,
                      SymbolType symbolType,
                      TExtension extension)
-    : TSymbol(symbolTable, name, symbolType, extension), type(t), unionArray(nullptr)
+    : TSymbol(symbolTable, name, symbolType, extension), mType(type), unionArray(nullptr)
 {
+    ASSERT(mType);
 }
 
 TStructure::TStructure(TSymbolTable *symbolTable,