Implement shader identifier name mapping.

The name mapping happens when an identifier is longer than 32 characters.  The name mapping is behind a flag, so it won't happen by default.  Also, functions to query the mapped names are added.

The purpose of this CL is for the drivers that can't handle long names.  For example, linux NVIDIA driver can't handle 256 character name, whereas WebGL spec requires that.

This CL also fixes the issue that some of the TIntermSymbols' ids are 0s.

ANGLEBUG=144
TEST=test manually with shaders with long identifier names.
Review URL: http://codereview.appspot.com/4428058

git-svn-id: https://angleproject.googlecode.com/svn/trunk@619 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index 6cac61d..051e4ec 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -37,7 +37,8 @@
                             int* length,
                             int* size,
                             ShDataType* type,
-                            char* name)
+                            char* name,
+                            char* mappedName)
 {
     if (!handle || !size || !type || !name)
         return;
@@ -59,6 +60,8 @@
     *size = varInfo.size;
     *type = varInfo.type;
     strcpy(name, varInfo.name.c_str());
+    if (mappedName)
+        strcpy(mappedName, varInfo.mappedName.c_str());
 }
 
 //
@@ -194,7 +197,9 @@
     case SH_ACTIVE_ATTRIBUTE_MAX_LENGTH:
         *params = getVariableMaxLength(compiler->getAttribs());
         break;
-
+    case SH_MAPPED_NAME_MAX_LENGTH:
+        *params = compiler->getMappedNameMaxLength();
+        break;
     default: UNREACHABLE();
     }
 }
@@ -236,10 +241,11 @@
                        int* length,
                        int* size,
                        ShDataType* type,
-                       char* name)
+                       char* name,
+                       char* mappedName)
 {
     getVariableInfo(SH_ACTIVE_ATTRIBUTES,
-                    handle, index, length, size, type, name);
+                    handle, index, length, size, type, name, mappedName);
 }
 
 void ShGetActiveUniform(const ShHandle handle,
@@ -247,8 +253,9 @@
                         int* length,
                         int* size,
                         ShDataType* type,
-                        char* name)
+                        char* name,
+                        char* mappedName)
 {
     getVariableInfo(SH_ACTIVE_UNIFORMS,
-                    handle, index, length, size, type, name);
+                    handle, index, length, size, type, name, mappedName);
 }