Set proper symbol ids on temporary symbol nodes

Temporary symbols used to all have symbol id 0. Now they get assigned
unique symbol ids. This makes it possible to keep track of them
according to the symbol id instead of their name, paving way to more
robust AST handling in the future.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: I292e2e483cc39173524fd30a30b48c4c808442e5
Reviewed-on: https://chromium-review.googlesource.com/559335
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 706bc40..eebc7c8 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -240,7 +240,7 @@
       mDiagnostics(infoSink.info),
       mSourcePath(nullptr),
       mComputeShaderLocalSizeDeclared(false),
-      mTemporaryIndex(0)
+      mTemporaryId()
 {
     mComputeShaderLocalSize.fill(1);
 }
@@ -434,7 +434,7 @@
 
         // This pass might emit short circuits so keep it before the short circuit unfolding
         if (success && (compileOptions & SH_REWRITE_DO_WHILE_LOOPS))
-            RewriteDoWhile(root, getTemporaryIndex());
+            RewriteDoWhile(root, getTemporaryId());
 
         if (success && (compileOptions & SH_ADD_AND_TRUE_TO_LOOP_CONDITION))
             sh::AddAndTrueToLoopCondition(root);
@@ -501,7 +501,7 @@
         if (success && (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS))
         {
             ScalarizeVecAndMatConstructorArgs(root, shaderType, fragmentPrecisionHigh,
-                                              &mTemporaryIndex);
+                                              getTemporaryId());
         }
 
         if (success && (compileOptions & SH_REGENERATE_STRUCT_NAMES))
@@ -537,7 +537,7 @@
                                        IntermNodePatternMatcher::kMultiDeclaration |
                                            IntermNodePatternMatcher::kArrayDeclaration |
                                            IntermNodePatternMatcher::kNamelessStructDeclaration,
-                                       getTemporaryIndex(), getSymbolTable(), getShaderVersion());
+                                       getTemporaryId(), getSymbolTable(), getShaderVersion());
             }
             // We only really need to separate array declarations and nameless struct declarations,
             // but it's simpler to just use the regular SeparateDeclarations.
@@ -742,7 +742,7 @@
     nameMap.clear();
 
     mSourcePath     = nullptr;
-    mTemporaryIndex = 0;
+    mTemporaryId    = TSymbolUniqueId();
 }
 
 bool TCompiler::initCallDag(TIntermNode *root)