translator: Put ShaderLang APIs in "sh" namespace.

Working with glslang in Vulkan means we are static linking libANGLE
with functions that have the same name as our translator APIs. We
can fix this by scoping our APIs. We don't need to scope the types
of the file, since they don't conflict.

This will require a follow-up patch to remove the unscoped APIs
once we switch over Chromium.

We also scope TCompiler and some related classes to avoid multiply
defined link errors with glslang.

BUG=angleproject:1576

Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16
Reviewed-on: https://chromium-review.googlesource.com/408337
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/fuzz/translator_fuzzer.cpp b/src/compiler/fuzz/translator_fuzzer.cpp
index 5185522..b772b4a 100644
--- a/src/compiler/fuzz/translator_fuzzer.cpp
+++ b/src/compiler/fuzz/translator_fuzzer.cpp
@@ -14,6 +14,8 @@
 #include "compiler/translator/Compiler.h"
 #include "angle_gl.h"
 
+using namespace sh;
+
 struct TranslatorCacheKey
 {
     bool operator==(const TranslatorCacheKey &other) const
diff --git a/src/compiler/translator/CodeGen.cpp b/src/compiler/translator/CodeGen.cpp
index f099bcc..6bf6dc5 100644
--- a/src/compiler/translator/CodeGen.cpp
+++ b/src/compiler/translator/CodeGen.cpp
@@ -16,6 +16,9 @@
 #include "compiler/translator/TranslatorHLSL.h"
 #endif // ANGLE_ENABLE_HLSL
 
+namespace sh
+{
+
 //
 // This function must be provided to create the actual
 // compile object used by higher level code.  It returns
@@ -29,10 +32,10 @@
 #ifdef ANGLE_ENABLE_ESSL
         return new TranslatorESSL(type, spec);
 #else
-        // This compiler is not supported in this
-        // configuration. Return NULL per the ShConstructCompiler API.
-        return nullptr;
-#endif // ANGLE_ENABLE_ESSL
+          // This compiler is not supported in this configuration. Return NULL per the
+          // sh::ConstructCompiler API.
+          return nullptr;
+#endif  // ANGLE_ENABLE_ESSL
       case SH_GLSL_130_OUTPUT:
       case SH_GLSL_140_OUTPUT:
       case SH_GLSL_150_CORE_OUTPUT:
@@ -47,23 +50,23 @@
 #ifdef ANGLE_ENABLE_GLSL
         return new TranslatorGLSL(type, spec, output);
 #else
-        // This compiler is not supported in this
-        // configuration. Return NULL per the ShConstructCompiler API.
-        return nullptr;
-#endif // ANGLE_ENABLE_GLSL
+          // This compiler is not supported in this configuration. Return NULL per the
+          // sh::ConstructCompiler API.
+          return nullptr;
+#endif  // ANGLE_ENABLE_GLSL
       case SH_HLSL_3_0_OUTPUT:
       case SH_HLSL_4_1_OUTPUT:
       case SH_HLSL_4_0_FL9_3_OUTPUT:
 #ifdef ANGLE_ENABLE_HLSL
         return new TranslatorHLSL(type, spec, output);
 #else
-        // This compiler is not supported in this
-        // configuration. Return NULL per the ShConstructCompiler API.
-        return nullptr;
-#endif // ANGLE_ENABLE_HLSL
+          // This compiler is not supported in this configuration. Return NULL per the
+          // sh::ConstructCompiler API.
+          return nullptr;
+#endif  // ANGLE_ENABLE_HLSL
       default:
-        // Unknown format. Return NULL per the ShConstructCompiler API.
-        return nullptr;
+          // Unknown format. Return NULL per the sh::ConstructCompiler API.
+          return nullptr;
     }
 }
 
@@ -74,3 +77,5 @@
 {
     delete compiler;
 }
+
+}  // namespace sh
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index c1be552..7689a03 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -35,6 +35,9 @@
 #include "compiler/translator/VariablePacker.h"
 #include "third_party/compiler/ArrayBoundsClamper.h"
 
+namespace sh
+{
+
 namespace
 {
 
@@ -80,24 +83,17 @@
 
 bool IsGLSL130OrNewer(ShShaderOutput output)
 {
-    return (output == SH_GLSL_130_OUTPUT ||
-            output == SH_GLSL_140_OUTPUT ||
-            output == SH_GLSL_150_CORE_OUTPUT ||
-            output == SH_GLSL_330_CORE_OUTPUT ||
-            output == SH_GLSL_400_CORE_OUTPUT ||
-            output == SH_GLSL_410_CORE_OUTPUT ||
-            output == SH_GLSL_420_CORE_OUTPUT ||
-            output == SH_GLSL_430_CORE_OUTPUT ||
-            output == SH_GLSL_440_CORE_OUTPUT ||
-            output == SH_GLSL_450_CORE_OUTPUT);
+    return (output == SH_GLSL_130_OUTPUT || output == SH_GLSL_140_OUTPUT ||
+            output == SH_GLSL_150_CORE_OUTPUT || output == SH_GLSL_330_CORE_OUTPUT ||
+            output == SH_GLSL_400_CORE_OUTPUT || output == SH_GLSL_410_CORE_OUTPUT ||
+            output == SH_GLSL_420_CORE_OUTPUT || output == SH_GLSL_430_CORE_OUTPUT ||
+            output == SH_GLSL_440_CORE_OUTPUT || output == SH_GLSL_450_CORE_OUTPUT);
 }
 
 bool IsGLSL420OrNewer(ShShaderOutput output)
 {
-    return (output == SH_GLSL_420_CORE_OUTPUT ||
-            output == SH_GLSL_430_CORE_OUTPUT ||
-            output == SH_GLSL_440_CORE_OUTPUT ||
-            output == SH_GLSL_450_CORE_OUTPUT);
+    return (output == SH_GLSL_420_CORE_OUTPUT || output == SH_GLSL_430_CORE_OUTPUT ||
+            output == SH_GLSL_440_CORE_OUTPUT || output == SH_GLSL_450_CORE_OUTPUT);
 }
 
 size_t GetGlobalMaxTokenSize(ShShaderSpec spec)
@@ -106,10 +102,10 @@
     // size undefined. ES3 defines a max size of 1024 characters.
     switch (spec)
     {
-      case SH_WEBGL_SPEC:
-        return 256;
-      default:
-        return 1024;
+        case SH_WEBGL_SPEC:
+            return 256;
+        default:
+            return 1024;
     }
 }
 
@@ -155,18 +151,18 @@
 {
     switch (spec)
     {
-      case SH_GLES2_SPEC:
-      case SH_WEBGL_SPEC:
-        return 100;
-      case SH_GLES3_SPEC:
-      case SH_WEBGL2_SPEC:
-        return 300;
-      case SH_GLES3_1_SPEC:
-      case SH_WEBGL3_SPEC:
-          return 310;
-      default:
-        UNREACHABLE();
-        return 0;
+        case SH_GLES2_SPEC:
+        case SH_WEBGL_SPEC:
+            return 100;
+        case SH_GLES3_SPEC:
+        case SH_WEBGL2_SPEC:
+            return 300;
+        case SH_GLES3_1_SPEC:
+        case SH_WEBGL3_SPEC:
+            return 310;
+        default:
+            UNREACHABLE();
+            return 0;
     }
 }
 
@@ -534,21 +530,21 @@
     TPublicType floatingPoint;
     floatingPoint.initializeBasicType(EbtFloat);
 
-    switch(shaderType)
+    switch (shaderType)
     {
-      case GL_FRAGMENT_SHADER:
-        symbolTable.setDefaultPrecision(integer, EbpMedium);
-        break;
-      case GL_VERTEX_SHADER:
-        symbolTable.setDefaultPrecision(integer, EbpHigh);
-        symbolTable.setDefaultPrecision(floatingPoint, EbpHigh);
-        break;
-      case GL_COMPUTE_SHADER:
-          symbolTable.setDefaultPrecision(integer, EbpHigh);
-          symbolTable.setDefaultPrecision(floatingPoint, EbpHigh);
-          break;
-      default:
-        assert(false && "Language not supported");
+        case GL_FRAGMENT_SHADER:
+            symbolTable.setDefaultPrecision(integer, EbpMedium);
+            break;
+        case GL_VERTEX_SHADER:
+            symbolTable.setDefaultPrecision(integer, EbpHigh);
+            symbolTable.setDefaultPrecision(floatingPoint, EbpHigh);
+            break;
+        case GL_COMPUTE_SHADER:
+            symbolTable.setDefaultPrecision(integer, EbpHigh);
+            symbolTable.setDefaultPrecision(floatingPoint, EbpHigh);
+            break;
+        default:
+            assert(false && "Language not supported");
     }
     // Set defaults for sampler types that have default precision, even those that are
     // only available if an extension exists.
@@ -581,60 +577,60 @@
 
     // clang-format off
     strstream << ":MaxVertexAttribs:" << compileResources.MaxVertexAttribs
-              << ":MaxVertexUniformVectors:" << compileResources.MaxVertexUniformVectors
-              << ":MaxVaryingVectors:" << compileResources.MaxVaryingVectors
-              << ":MaxVertexTextureImageUnits:" << compileResources.MaxVertexTextureImageUnits
-              << ":MaxCombinedTextureImageUnits:" << compileResources.MaxCombinedTextureImageUnits
-              << ":MaxTextureImageUnits:" << compileResources.MaxTextureImageUnits
-              << ":MaxFragmentUniformVectors:" << compileResources.MaxFragmentUniformVectors
-              << ":MaxDrawBuffers:" << compileResources.MaxDrawBuffers
-              << ":OES_standard_derivatives:" << compileResources.OES_standard_derivatives
-              << ":OES_EGL_image_external:" << compileResources.OES_EGL_image_external
-              << ":OES_EGL_image_external_essl3:" << compileResources.OES_EGL_image_external_essl3
-              << ":NV_EGL_stream_consumer_external:" << compileResources.NV_EGL_stream_consumer_external
-              << ":ARB_texture_rectangle:" << compileResources.ARB_texture_rectangle
-              << ":EXT_draw_buffers:" << compileResources.EXT_draw_buffers
-              << ":FragmentPrecisionHigh:" << compileResources.FragmentPrecisionHigh
-              << ":MaxExpressionComplexity:" << compileResources.MaxExpressionComplexity
-              << ":MaxCallStackDepth:" << compileResources.MaxCallStackDepth
-              << ":MaxFunctionParameters:" << compileResources.MaxFunctionParameters
-              << ":EXT_blend_func_extended:" << compileResources.EXT_blend_func_extended
-              << ":EXT_frag_depth:" << compileResources.EXT_frag_depth
-              << ":EXT_shader_texture_lod:" << compileResources.EXT_shader_texture_lod
-              << ":EXT_shader_framebuffer_fetch:" << compileResources.EXT_shader_framebuffer_fetch
-              << ":NV_shader_framebuffer_fetch:" << compileResources.NV_shader_framebuffer_fetch
-              << ":ARM_shader_framebuffer_fetch:" << compileResources.ARM_shader_framebuffer_fetch
-              << ":MaxVertexOutputVectors:" << compileResources.MaxVertexOutputVectors
-              << ":MaxFragmentInputVectors:" << compileResources.MaxFragmentInputVectors
-              << ":MinProgramTexelOffset:" << compileResources.MinProgramTexelOffset
-              << ":MaxProgramTexelOffset:" << compileResources.MaxProgramTexelOffset
-              << ":MaxDualSourceDrawBuffers:" << compileResources.MaxDualSourceDrawBuffers
-              << ":NV_draw_buffers:" << compileResources.NV_draw_buffers
-              << ":WEBGL_debug_shader_precision:" << compileResources.WEBGL_debug_shader_precision
-              << ":MaxImageUnits:" << compileResources.MaxImageUnits
-              << ":MaxVertexImageUniforms:" << compileResources.MaxVertexImageUniforms
-              << ":MaxFragmentImageUniforms:" << compileResources.MaxFragmentImageUniforms
-              << ":MaxComputeImageUniforms:" << compileResources.MaxComputeImageUniforms
-              << ":MaxCombinedImageUniforms:" << compileResources.MaxCombinedImageUniforms
-              << ":MaxCombinedShaderOutputResources:" << compileResources.MaxCombinedShaderOutputResources
-              << ":MaxComputeWorkGroupCountX:" << compileResources.MaxComputeWorkGroupCount[0]
-              << ":MaxComputeWorkGroupCountY:" << compileResources.MaxComputeWorkGroupCount[1]
-              << ":MaxComputeWorkGroupCountZ:" << compileResources.MaxComputeWorkGroupCount[2]
-              << ":MaxComputeWorkGroupSizeX:" << compileResources.MaxComputeWorkGroupSize[0]
-              << ":MaxComputeWorkGroupSizeY:" << compileResources.MaxComputeWorkGroupSize[1]
-              << ":MaxComputeWorkGroupSizeZ:" << compileResources.MaxComputeWorkGroupSize[2]
-              << ":MaxComputeUniformComponents:" << compileResources.MaxComputeUniformComponents
-              << ":MaxComputeTextureImageUnits:" << compileResources.MaxComputeTextureImageUnits
-              << ":MaxComputeAtomicCounters:" << compileResources.MaxComputeAtomicCounters
-              << ":MaxComputeAtomicCounterBuffers:" << compileResources.MaxComputeAtomicCounterBuffers
-              << ":MaxVertexAtomicCounters:" << compileResources.MaxVertexAtomicCounters
-              << ":MaxFragmentAtomicCounters:" << compileResources.MaxFragmentAtomicCounters
-              << ":MaxCombinedAtomicCounters:" << compileResources.MaxCombinedAtomicCounters
-              << ":MaxAtomicCounterBindings:" << compileResources.MaxAtomicCounterBindings
-              << ":MaxVertexAtomicCounterBuffers:" << compileResources.MaxVertexAtomicCounterBuffers
-              << ":MaxFragmentAtomicCounterBuffers:" << compileResources.MaxFragmentAtomicCounterBuffers
-              << ":MaxCombinedAtomicCounterBuffers:" << compileResources.MaxCombinedAtomicCounterBuffers
-              << ":MaxAtomicCounterBufferSize:" << compileResources.MaxAtomicCounterBufferSize;
+        << ":MaxVertexUniformVectors:" << compileResources.MaxVertexUniformVectors
+        << ":MaxVaryingVectors:" << compileResources.MaxVaryingVectors
+        << ":MaxVertexTextureImageUnits:" << compileResources.MaxVertexTextureImageUnits
+        << ":MaxCombinedTextureImageUnits:" << compileResources.MaxCombinedTextureImageUnits
+        << ":MaxTextureImageUnits:" << compileResources.MaxTextureImageUnits
+        << ":MaxFragmentUniformVectors:" << compileResources.MaxFragmentUniformVectors
+        << ":MaxDrawBuffers:" << compileResources.MaxDrawBuffers
+        << ":OES_standard_derivatives:" << compileResources.OES_standard_derivatives
+        << ":OES_EGL_image_external:" << compileResources.OES_EGL_image_external
+        << ":OES_EGL_image_external_essl3:" << compileResources.OES_EGL_image_external_essl3
+        << ":NV_EGL_stream_consumer_external:" << compileResources.NV_EGL_stream_consumer_external
+        << ":ARB_texture_rectangle:" << compileResources.ARB_texture_rectangle
+        << ":EXT_draw_buffers:" << compileResources.EXT_draw_buffers
+        << ":FragmentPrecisionHigh:" << compileResources.FragmentPrecisionHigh
+        << ":MaxExpressionComplexity:" << compileResources.MaxExpressionComplexity
+        << ":MaxCallStackDepth:" << compileResources.MaxCallStackDepth
+        << ":MaxFunctionParameters:" << compileResources.MaxFunctionParameters
+        << ":EXT_blend_func_extended:" << compileResources.EXT_blend_func_extended
+        << ":EXT_frag_depth:" << compileResources.EXT_frag_depth
+        << ":EXT_shader_texture_lod:" << compileResources.EXT_shader_texture_lod
+        << ":EXT_shader_framebuffer_fetch:" << compileResources.EXT_shader_framebuffer_fetch
+        << ":NV_shader_framebuffer_fetch:" << compileResources.NV_shader_framebuffer_fetch
+        << ":ARM_shader_framebuffer_fetch:" << compileResources.ARM_shader_framebuffer_fetch
+        << ":MaxVertexOutputVectors:" << compileResources.MaxVertexOutputVectors
+        << ":MaxFragmentInputVectors:" << compileResources.MaxFragmentInputVectors
+        << ":MinProgramTexelOffset:" << compileResources.MinProgramTexelOffset
+        << ":MaxProgramTexelOffset:" << compileResources.MaxProgramTexelOffset
+        << ":MaxDualSourceDrawBuffers:" << compileResources.MaxDualSourceDrawBuffers
+        << ":NV_draw_buffers:" << compileResources.NV_draw_buffers
+        << ":WEBGL_debug_shader_precision:" << compileResources.WEBGL_debug_shader_precision
+        << ":MaxImageUnits:" << compileResources.MaxImageUnits
+        << ":MaxVertexImageUniforms:" << compileResources.MaxVertexImageUniforms
+        << ":MaxFragmentImageUniforms:" << compileResources.MaxFragmentImageUniforms
+        << ":MaxComputeImageUniforms:" << compileResources.MaxComputeImageUniforms
+        << ":MaxCombinedImageUniforms:" << compileResources.MaxCombinedImageUniforms
+        << ":MaxCombinedShaderOutputResources:" << compileResources.MaxCombinedShaderOutputResources
+        << ":MaxComputeWorkGroupCountX:" << compileResources.MaxComputeWorkGroupCount[0]
+        << ":MaxComputeWorkGroupCountY:" << compileResources.MaxComputeWorkGroupCount[1]
+        << ":MaxComputeWorkGroupCountZ:" << compileResources.MaxComputeWorkGroupCount[2]
+        << ":MaxComputeWorkGroupSizeX:" << compileResources.MaxComputeWorkGroupSize[0]
+        << ":MaxComputeWorkGroupSizeY:" << compileResources.MaxComputeWorkGroupSize[1]
+        << ":MaxComputeWorkGroupSizeZ:" << compileResources.MaxComputeWorkGroupSize[2]
+        << ":MaxComputeUniformComponents:" << compileResources.MaxComputeUniformComponents
+        << ":MaxComputeTextureImageUnits:" << compileResources.MaxComputeTextureImageUnits
+        << ":MaxComputeAtomicCounters:" << compileResources.MaxComputeAtomicCounters
+        << ":MaxComputeAtomicCounterBuffers:" << compileResources.MaxComputeAtomicCounterBuffers
+        << ":MaxVertexAtomicCounters:" << compileResources.MaxVertexAtomicCounters
+        << ":MaxFragmentAtomicCounters:" << compileResources.MaxFragmentAtomicCounters
+        << ":MaxCombinedAtomicCounters:" << compileResources.MaxCombinedAtomicCounters
+        << ":MaxAtomicCounterBindings:" << compileResources.MaxAtomicCounterBindings
+        << ":MaxVertexAtomicCounterBuffers:" << compileResources.MaxVertexAtomicCounterBuffers
+        << ":MaxFragmentAtomicCounterBuffers:" << compileResources.MaxFragmentAtomicCounterBuffers
+        << ":MaxCombinedAtomicCounterBuffers:" << compileResources.MaxCombinedAtomicCounterBuffers
+        << ":MaxAtomicCounterBufferSize:" << compileResources.MaxAtomicCounterBufferSize;
     // clang-format on
 
     builtInResourcesString = strstream.str();
@@ -669,16 +665,16 @@
 
     switch (mCallDag.init(root, &infoSink.info))
     {
-      case CallDAG::INITDAG_SUCCESS:
-        return true;
-      case CallDAG::INITDAG_RECURSION:
-        infoSink.info.prefix(EPrefixError);
-        infoSink.info << "Function recursion detected";
-        return false;
-      case CallDAG::INITDAG_UNDEFINED:
-        infoSink.info.prefix(EPrefixError);
-        infoSink.info << "Unimplemented function detected";
-        return false;
+        case CallDAG::INITDAG_SUCCESS:
+            return true;
+        case CallDAG::INITDAG_RECURSION:
+            infoSink.info.prefix(EPrefixError);
+            infoSink.info << "Function recursion detected";
+            return false;
+        case CallDAG::INITDAG_UNDEFINED:
+            infoSink.info.prefix(EPrefixError);
+            infoSink.info << "Unimplemented function detected";
+            return false;
     }
 
     UNREACHABLE();
@@ -772,8 +768,7 @@
 {
   public:
     UnusedPredicate(const CallDAG *callDag, const std::vector<FunctionMetadata> *metadatas)
-        : mCallDag(callDag),
-          mMetadatas(metadatas)
+        : mCallDag(callDag), mMetadatas(metadatas)
     {
     }
 
@@ -846,7 +841,7 @@
 
 bool TCompiler::limitExpressionComplexity(TIntermNode* root)
 {
-    TMaxDepthTraverser traverser(maxExpressionComplexity+1);
+    TMaxDepthTraverser traverser(maxExpressionComplexity + 1);
     root->traverse(&traverser);
 
     if (traverser.getMaxDepth() > maxExpressionComplexity)
@@ -869,7 +864,8 @@
     if (!variablesCollected)
     {
         sh::CollectVariables collect(&attributes, &outputVariables, &uniforms, &varyings,
-                                     &interfaceBlocks, hashFunction, symbolTable, extensionBehavior);
+                                     &interfaceBlocks, hashFunction, symbolTable,
+                                     extensionBehavior);
         root->traverse(&collect);
 
         // This is for enforcePackingRestriction().
@@ -993,3 +989,5 @@
 
     return false;
 }
+
+}  // namespace sh
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index da57012..603d7eb 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -24,6 +24,9 @@
 #include "compiler/translator/VariableInfo.h"
 #include "third_party/compiler/ArrayBoundsClamper.h"
 
+namespace sh
+{
+
 class TCompiler;
 #ifdef ANGLE_ENABLE_HLSL
 class TranslatorHLSL;
@@ -257,4 +260,6 @@
     sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
 void DeleteCompiler(TCompiler*);
 
+}  // namespace sh
+
 #endif // COMPILER_TRANSLATOR_COMPILER_H_
diff --git a/src/compiler/translator/EmulatePrecision.cpp b/src/compiler/translator/EmulatePrecision.cpp
index f38d925..94cdf50 100644
--- a/src/compiler/translator/EmulatePrecision.cpp
+++ b/src/compiler/translator/EmulatePrecision.cpp
@@ -716,6 +716,6 @@
         default:
             // Other languages not yet supported
             return (outputLanguage == SH_GLSL_COMPATIBILITY_OUTPUT ||
-                    IsGLSL130OrNewer(outputLanguage));
+                    sh::IsGLSL130OrNewer(outputLanguage));
     }
 }
diff --git a/src/compiler/translator/OutputGLSL.cpp b/src/compiler/translator/OutputGLSL.cpp
index 928c073..76a0012 100644
--- a/src/compiler/translator/OutputGLSL.cpp
+++ b/src/compiler/translator/OutputGLSL.cpp
@@ -39,11 +39,11 @@
     {
         out << "gl_FragDepth";
     }
-    else if (symbol == "gl_FragColor" && IsGLSL130OrNewer(getShaderOutput()))
+    else if (symbol == "gl_FragColor" && sh::IsGLSL130OrNewer(getShaderOutput()))
     {
         out << "webgl_FragColor";
     }
-    else if (symbol == "gl_FragData" && IsGLSL130OrNewer(getShaderOutput()))
+    else if (symbol == "gl_FragData" && sh::IsGLSL130OrNewer(getShaderOutput()))
     {
         out << "webgl_FragData";
     }
@@ -89,8 +89,8 @@
         "textureCubeGradEXT", "textureGrad",
         NULL, NULL
     };
-    const char **mapping = (IsGLSL130OrNewer(getShaderOutput())) ?
-        legacyToCoreRename : simpleRename;
+    const char **mapping =
+        (sh::IsGLSL130OrNewer(getShaderOutput())) ? legacyToCoreRename : simpleRename;
 
     for (int i = 0; mapping[i] != NULL; i += 2)
     {
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index a81f154..172de43 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -150,7 +150,7 @@
 {
     TQualifier qualifier = type.getQualifier();
     TInfoSinkBase &out = objSink();
-    bool removeInvariant = (qualifier == EvqVaryingIn && IsGLSL420OrNewer(mOutput) &&
+    bool removeInvariant = (qualifier == EvqVaryingIn && sh::IsGLSL420OrNewer(mOutput) &&
                             !(mCompileOptions & SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT));
     if (type.isInvariant() && !removeInvariant)
     {
@@ -163,7 +163,7 @@
     }
     if (qualifier != EvqTemporary && qualifier != EvqGlobal)
     {
-        if (IsGLSL130OrNewer(mOutput))
+        if (sh::IsGLSL130OrNewer(mOutput))
         {
             switch (qualifier)
             {
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index 344c92f..eb96d2a 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -65,6 +65,50 @@
 
 }  // namespace
 
+TParseContext::TParseContext(TSymbolTable &symt,
+                             TExtensionBehavior &ext,
+                             sh::GLenum type,
+                             ShShaderSpec spec,
+                             ShCompileOptions options,
+                             bool checksPrecErrors,
+                             TInfoSink &is,
+                             const ShBuiltInResources &resources)
+    : intermediate(),
+      symbolTable(symt),
+      mDeferredSingleDeclarationErrorCheck(false),
+      mShaderType(type),
+      mShaderSpec(spec),
+      mCompileOptions(options),
+      mShaderVersion(100),
+      mTreeRoot(nullptr),
+      mLoopNestingLevel(0),
+      mStructNestingLevel(0),
+      mSwitchNestingLevel(0),
+      mCurrentFunctionType(nullptr),
+      mFunctionReturnsValue(false),
+      mChecksPrecisionErrors(checksPrecErrors),
+      mFragmentPrecisionHighOnESSL1(false),
+      mDefaultMatrixPacking(EmpColumnMajor),
+      mDefaultBlockStorage(sh::IsWebGLBasedSpec(spec) ? EbsStd140 : EbsShared),
+      mDiagnostics(is),
+      mDirectiveHandler(ext,
+                        mDiagnostics,
+                        mShaderVersion,
+                        mShaderType,
+                        resources.WEBGL_debug_shader_precision == 1),
+      mPreprocessor(&mDiagnostics, &mDirectiveHandler),
+      mScanner(nullptr),
+      mUsesFragData(false),
+      mUsesFragColor(false),
+      mUsesSecondaryOutputs(false),
+      mMinProgramTexelOffset(resources.MinProgramTexelOffset),
+      mMaxProgramTexelOffset(resources.MaxProgramTexelOffset),
+      mComputeShaderLocalSizeDeclared(false),
+      mDeclaringFunction(false)
+{
+    mComputeShaderLocalSize.fill(-1);
+}
+
 //
 // Look at a '.' field selector string and change it into offsets
 // for a vector.
@@ -481,7 +525,7 @@
             error(line, reservedErrMsg, "gl_");
             return false;
         }
-        if (IsWebGLBasedSpec(mShaderSpec))
+        if (sh::IsWebGLBasedSpec(mShaderSpec))
         {
             if (identifier.compare(0, 6, "webgl_") == 0)
             {
@@ -2844,7 +2888,7 @@
 
 void TParseContext::checkIsBelowStructNestingLimit(const TSourceLoc &line, const TField &field)
 {
-    if (!IsWebGLBasedSpec(mShaderSpec))
+    if (!sh::IsWebGLBasedSpec(mShaderSpec))
     {
         return;
     }
@@ -3134,7 +3178,7 @@
 
     if (qualifierType == "shared")
     {
-        if (IsWebGLBasedSpec(mShaderSpec))
+        if (sh::IsWebGLBasedSpec(mShaderSpec))
         {
             error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "shared");
         }
@@ -3142,7 +3186,7 @@
     }
     else if (qualifierType == "packed")
     {
-        if (IsWebGLBasedSpec(mShaderSpec))
+        if (sh::IsWebGLBasedSpec(mShaderSpec))
         {
             error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "packed");
         }
diff --git a/src/compiler/translator/ParseContext.h b/src/compiler/translator/ParseContext.h
index 68fda25..27b53bb 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -36,42 +36,7 @@
                   ShCompileOptions options,
                   bool checksPrecErrors,
                   TInfoSink &is,
-                  const ShBuiltInResources &resources)
-        : intermediate(),
-          symbolTable(symt),
-          mDeferredSingleDeclarationErrorCheck(false),
-          mShaderType(type),
-          mShaderSpec(spec),
-          mCompileOptions(options),
-          mShaderVersion(100),
-          mTreeRoot(nullptr),
-          mLoopNestingLevel(0),
-          mStructNestingLevel(0),
-          mSwitchNestingLevel(0),
-          mCurrentFunctionType(nullptr),
-          mFunctionReturnsValue(false),
-          mChecksPrecisionErrors(checksPrecErrors),
-          mFragmentPrecisionHighOnESSL1(false),
-          mDefaultMatrixPacking(EmpColumnMajor),
-          mDefaultBlockStorage(IsWebGLBasedSpec(spec) ? EbsStd140 : EbsShared),
-          mDiagnostics(is),
-          mDirectiveHandler(ext,
-                            mDiagnostics,
-                            mShaderVersion,
-                            mShaderType,
-                            resources.WEBGL_debug_shader_precision == 1),
-          mPreprocessor(&mDiagnostics, &mDirectiveHandler),
-          mScanner(nullptr),
-          mUsesFragData(false),
-          mUsesFragColor(false),
-          mUsesSecondaryOutputs(false),
-          mMinProgramTexelOffset(resources.MinProgramTexelOffset),
-          mMaxProgramTexelOffset(resources.MaxProgramTexelOffset),
-          mComputeShaderLocalSizeDeclared(false),
-          mDeclaringFunction(false)
-    {
-        mComputeShaderLocalSize.fill(-1);
-    }
+                  const ShBuiltInResources &resources);
 
     const pp::Preprocessor &getPreprocessor() const { return mPreprocessor; }
     pp::Preprocessor &getPreprocessor() { return mPreprocessor; }
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 37b1114..b776ca5 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -20,6 +20,8 @@
 #include "compiler/translator/VariablePacker.h"
 #include "angle_gl.h"
 
+using namespace sh;
+
 namespace
 {
 
@@ -34,31 +36,31 @@
 const std::vector<VarT> *GetVariableList(const TCompiler *compiler);
 
 template <>
-const std::vector<sh::Uniform> *GetVariableList(const TCompiler *compiler)
+const std::vector<Uniform> *GetVariableList(const TCompiler *compiler)
 {
     return &compiler->getUniforms();
 }
 
 template <>
-const std::vector<sh::Varying> *GetVariableList(const TCompiler *compiler)
+const std::vector<Varying> *GetVariableList(const TCompiler *compiler)
 {
     return &compiler->getVaryings();
 }
 
 template <>
-const std::vector<sh::Attribute> *GetVariableList(const TCompiler *compiler)
+const std::vector<Attribute> *GetVariableList(const TCompiler *compiler)
 {
     return &compiler->getAttributes();
 }
 
 template <>
-const std::vector<sh::OutputVariable> *GetVariableList(const TCompiler *compiler)
+const std::vector<OutputVariable> *GetVariableList(const TCompiler *compiler)
 {
     return &compiler->getOutputVariables();
 }
 
 template <>
-const std::vector<sh::InterfaceBlock> *GetVariableList(const TCompiler *compiler)
+const std::vector<InterfaceBlock> *GetVariableList(const TCompiler *compiler)
 {
     return &compiler->getInterfaceBlocks();
 }
@@ -235,8 +237,9 @@
     }
 
     // Generate built-in symbol table.
-    if (!compiler->Init(*resources)) {
-        ShDestruct(base);
+    if (!compiler->Init(*resources))
+    {
+        sh::Destruct(base);
         return 0;
     }
 
@@ -332,32 +335,32 @@
     return &(compiler->getNameMap());
 }
 
-const std::vector<sh::Uniform> *ShGetUniforms(const ShHandle handle)
+const std::vector<Uniform> *ShGetUniforms(const ShHandle handle)
 {
-    return GetShaderVariables<sh::Uniform>(handle);
+    return GetShaderVariables<Uniform>(handle);
 }
 
-const std::vector<sh::Varying> *ShGetVaryings(const ShHandle handle)
+const std::vector<Varying> *ShGetVaryings(const ShHandle handle)
 {
-    return GetShaderVariables<sh::Varying>(handle);
+    return GetShaderVariables<Varying>(handle);
 }
 
-const std::vector<sh::Attribute> *ShGetAttributes(const ShHandle handle)
+const std::vector<Attribute> *ShGetAttributes(const ShHandle handle)
 {
-    return GetShaderVariables<sh::Attribute>(handle);
+    return GetShaderVariables<Attribute>(handle);
 }
 
-const std::vector<sh::OutputVariable> *ShGetOutputVariables(const ShHandle handle)
+const std::vector<OutputVariable> *ShGetOutputVariables(const ShHandle handle)
 {
-    return GetShaderVariables<sh::OutputVariable>(handle);
+    return GetShaderVariables<OutputVariable>(handle);
 }
 
-const std::vector<sh::InterfaceBlock> *ShGetInterfaceBlocks(const ShHandle handle)
+const std::vector<InterfaceBlock> *ShGetInterfaceBlocks(const ShHandle handle)
 {
-    return GetShaderVariables<sh::InterfaceBlock>(handle);
+    return GetShaderVariables<InterfaceBlock>(handle);
 }
 
-sh::WorkGroupSize ShGetComputeShaderLocalGroupSize(const ShHandle handle)
+WorkGroupSize ShGetComputeShaderLocalGroupSize(const ShHandle handle)
 {
     ASSERT(handle);
 
@@ -369,7 +372,7 @@
 }
 
 bool ShCheckVariablesWithinPackingLimits(int maxVectors,
-                                         const std::vector<sh::ShaderVariable> &variables)
+                                         const std::vector<ShaderVariable> &variables)
 {
     VariablePacker packer;
     return packer.CheckVariablesWithinPackingLimits(maxVectors, variables);
@@ -408,3 +411,123 @@
     return nullptr;
 #endif  // ANGLE_ENABLE_HLSL
 }
+
+namespace sh
+{
+bool Initialize()
+{
+    return ShInitialize();
+}
+
+bool Finalize()
+{
+    return ShFinalize();
+}
+
+void InitBuiltInResources(ShBuiltInResources *resources)
+{
+    ShInitBuiltInResources(resources);
+}
+
+const std::string &GetBuiltInResourcesString(const ShHandle handle)
+{
+    return ShGetBuiltInResourcesString(handle);
+}
+
+ShHandle ConstructCompiler(sh::GLenum type,
+                           ShShaderSpec spec,
+                           ShShaderOutput output,
+                           const ShBuiltInResources *resources)
+{
+    return ShConstructCompiler(type, spec, output, resources);
+}
+
+void Destruct(ShHandle handle)
+{
+    return ShDestruct(handle);
+}
+
+bool Compile(const ShHandle handle,
+             const char *const shaderStrings[],
+             size_t numStrings,
+             ShCompileOptions compileOptions)
+{
+    return ShCompile(handle, shaderStrings, numStrings, compileOptions);
+}
+
+void ClearResults(const ShHandle handle)
+{
+    return ShClearResults(handle);
+}
+
+int GetShaderVersion(const ShHandle handle)
+{
+    return ShGetShaderVersion(handle);
+}
+
+ShShaderOutput GetShaderOutputType(const ShHandle handle)
+{
+    return ShGetShaderOutputType(handle);
+}
+
+const std::string &GetInfoLog(const ShHandle handle)
+{
+    return ShGetInfoLog(handle);
+}
+
+const std::string &GetObjectCode(const ShHandle handle)
+{
+    return ShGetObjectCode(handle);
+}
+
+const std::map<std::string, std::string> *GetNameHashingMap(const ShHandle handle)
+{
+    return ShGetNameHashingMap(handle);
+}
+
+const std::vector<sh::Uniform> *GetUniforms(const ShHandle handle)
+{
+    return ShGetUniforms(handle);
+}
+const std::vector<sh::Varying> *GetVaryings(const ShHandle handle)
+{
+    return ShGetVaryings(handle);
+}
+const std::vector<sh::Attribute> *GetAttributes(const ShHandle handle)
+{
+    return ShGetAttributes(handle);
+}
+
+const std::vector<sh::OutputVariable> *GetOutputVariables(const ShHandle handle)
+{
+    return ShGetOutputVariables(handle);
+}
+const std::vector<sh::InterfaceBlock> *GetInterfaceBlocks(const ShHandle handle)
+{
+    return ShGetInterfaceBlocks(handle);
+}
+
+sh::WorkGroupSize GetComputeShaderLocalGroupSize(const ShHandle handle)
+{
+    return ShGetComputeShaderLocalGroupSize(handle);
+}
+
+bool CheckVariablesWithinPackingLimits(int maxVectors,
+                                       const std::vector<sh::ShaderVariable> &variables)
+{
+    return ShCheckVariablesWithinPackingLimits(maxVectors, variables);
+}
+
+bool GetInterfaceBlockRegister(const ShHandle handle,
+                               const std::string &interfaceBlockName,
+                               unsigned int *indexOut)
+{
+    return ShGetInterfaceBlockRegister(handle, interfaceBlockName, indexOut);
+}
+
+const std::map<std::string, unsigned int> *GetUniformRegisterMap(const ShHandle handle)
+{
+    return ShGetUniformRegisterMap(handle);
+}
+
+}  // namespace sh
diff --git a/src/compiler/translator/TranslatorESSL.cpp b/src/compiler/translator/TranslatorESSL.cpp
index c942880..55c1b67 100644
--- a/src/compiler/translator/TranslatorESSL.cpp
+++ b/src/compiler/translator/TranslatorESSL.cpp
@@ -11,6 +11,9 @@
 #include "compiler/translator/OutputESSL.h"
 #include "angle_gl.h"
 
+namespace sh
+{
+
 TranslatorESSL::TranslatorESSL(sh::GLenum type, ShShaderSpec spec)
     : TCompiler(type, spec, SH_ESSL_OUTPUT)
 {
@@ -107,3 +110,5 @@
         }
     }
 }
+
+}  // namespace sh
diff --git a/src/compiler/translator/TranslatorESSL.h b/src/compiler/translator/TranslatorESSL.h
index f147ca0..b7b46a6 100644
--- a/src/compiler/translator/TranslatorESSL.h
+++ b/src/compiler/translator/TranslatorESSL.h
@@ -9,6 +9,9 @@
 
 #include "compiler/translator/Compiler.h"
 
+namespace sh
+{
+
 class TranslatorESSL : public TCompiler
 {
   public:
@@ -22,4 +25,6 @@
     void writeExtensionBehavior();
 };
 
+}  // namespace sh
+
 #endif  // COMPILER_TRANSLATOR_TRANSLATORESSL_H_
diff --git a/src/compiler/translator/TranslatorGLSL.cpp b/src/compiler/translator/TranslatorGLSL.cpp
index 5ba3e01..4bbff97 100644
--- a/src/compiler/translator/TranslatorGLSL.cpp
+++ b/src/compiler/translator/TranslatorGLSL.cpp
@@ -14,6 +14,9 @@
 #include "compiler/translator/RewriteTexelFetchOffset.h"
 #include "compiler/translator/VersionGLSL.h"
 
+namespace sh
+{
+
 TranslatorGLSL::TranslatorGLSL(sh::GLenum type,
                                ShShaderSpec spec,
                                ShShaderOutput output)
@@ -296,3 +299,5 @@
         sink << "invariant " << builtinVaryingName << ";\n";
     }
 }
+
+}  // namespace sh
diff --git a/src/compiler/translator/TranslatorGLSL.h b/src/compiler/translator/TranslatorGLSL.h
index af3b187..d6f6948 100644
--- a/src/compiler/translator/TranslatorGLSL.h
+++ b/src/compiler/translator/TranslatorGLSL.h
@@ -9,6 +9,9 @@
 
 #include "compiler/translator/Compiler.h"
 
+namespace sh
+{
+
 class TranslatorGLSL : public TCompiler
 {
   public:
@@ -28,4 +31,6 @@
     void conditionallyOutputInvariantDeclaration(const char *builtinVaryingName);
 };
 
+}  // namespace sh
+
 #endif  // COMPILER_TRANSLATOR_TRANSLATORGLSL_H_
diff --git a/src/compiler/translator/TranslatorHLSL.cpp b/src/compiler/translator/TranslatorHLSL.cpp
index fb011da..7ef1d4e 100644
--- a/src/compiler/translator/TranslatorHLSL.cpp
+++ b/src/compiler/translator/TranslatorHLSL.cpp
@@ -24,6 +24,9 @@
 #include "compiler/translator/SplitSequenceOperator.h"
 #include "compiler/translator/UnfoldShortCircuitToIf.h"
 
+namespace sh
+{
+
 TranslatorHLSL::TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
     : TCompiler(type, spec, output)
 {
@@ -141,3 +144,5 @@
 {
     return &mUniformRegisterMap;
 }
+
+}  // namespace sh
diff --git a/src/compiler/translator/TranslatorHLSL.h b/src/compiler/translator/TranslatorHLSL.h
index 213d860..3bf64b2 100644
--- a/src/compiler/translator/TranslatorHLSL.h
+++ b/src/compiler/translator/TranslatorHLSL.h
@@ -9,6 +9,9 @@
 
 #include "compiler/translator/Compiler.h"
 
+namespace sh
+{
+
 class TranslatorHLSL : public TCompiler
 {
   public:
@@ -31,4 +34,6 @@
     std::map<std::string, unsigned int> mUniformRegisterMap;
 };
 
+}  // namespace sh
+
 #endif  // COMPILER_TRANSLATOR_TRANSLATORHLSL_H_
diff --git a/src/compiler/translator/glslang.l b/src/compiler/translator/glslang.l
index ed82498..0924e83 100644
--- a/src/compiler/translator/glslang.l
+++ b/src/compiler/translator/glslang.l
@@ -599,7 +599,7 @@
     if (context->getFragmentPrecisionHigh())
         preprocessor->predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
 
-    preprocessor->setMaxTokenSize(GetGlobalMaxTokenSize(context->getShaderSpec()));
+    preprocessor->setMaxTokenSize(sh::GetGlobalMaxTokenSize(context->getShaderSpec()));
 
     return 0;
 }
diff --git a/src/compiler/translator/glslang_lex.cpp b/src/compiler/translator/glslang_lex.cpp
index 0e23a0f..77f0bea 100644
--- a/src/compiler/translator/glslang_lex.cpp
+++ b/src/compiler/translator/glslang_lex.cpp
@@ -3260,7 +3260,7 @@
     if (context->getFragmentPrecisionHigh())
         preprocessor->predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
 
-    preprocessor->setMaxTokenSize(GetGlobalMaxTokenSize(context->getShaderSpec()));
+    preprocessor->setMaxTokenSize(sh::GetGlobalMaxTokenSize(context->getShaderSpec()));
 
     return 0;
 }
diff --git a/src/compiler/translator/length_limits.h b/src/compiler/translator/length_limits.h
index 8863438..607157f 100644
--- a/src/compiler/translator/length_limits.h
+++ b/src/compiler/translator/length_limits.h
@@ -16,6 +16,11 @@
 // These constants are factored out from the rest of the headers to
 // make it easier to reference them from the compiler sources.
 
+namespace sh
+{
+
 size_t GetGlobalMaxTokenSize(ShShaderSpec spec);
 
+}  // namespace sh
+
 #endif // COMPILER_TRANSLATOR_LENGTHLIMITS_H_
diff --git a/src/libANGLE/Compiler.cpp b/src/libANGLE/Compiler.cpp
index bc57042..0784912 100644
--- a/src/libANGLE/Compiler.cpp
+++ b/src/libANGLE/Compiler.cpp
@@ -19,8 +19,8 @@
 namespace
 {
 
-// Global count of active shader compiler handles. Needed to know when to call ShInitialize and
-// ShFinalize.
+// Global count of active shader compiler handles. Needed to know when to call sh::Initialize and
+// sh::Finalize.
 size_t activeCompilerHandles = 0;
 
 ShShaderSpec SelectShaderSpec(GLint majorVersion, GLint minorVersion, bool isWebGL)
@@ -57,7 +57,7 @@
     const gl::Caps &caps             = state.getCaps();
     const gl::Extensions &extensions = state.getExtensions();
 
-    ShInitBuiltInResources(&mResources);
+    sh::InitBuiltInResources(&mResources);
     mResources.MaxVertexAttribs             = caps.maxVertexAttributes;
     mResources.MaxVertexUniformVectors      = caps.maxVertexUniformVectors;
     mResources.MaxVaryingVectors            = caps.maxVaryingVectors;
@@ -122,7 +122,7 @@
 {
     if (mFragmentCompiler)
     {
-        ShDestruct(mFragmentCompiler);
+        sh::Destruct(mFragmentCompiler);
         mFragmentCompiler = nullptr;
 
         ASSERT(activeCompilerHandles > 0);
@@ -131,7 +131,7 @@
 
     if (mVertexCompiler)
     {
-        ShDestruct(mVertexCompiler);
+        sh::Destruct(mVertexCompiler);
         mVertexCompiler = nullptr;
 
         ASSERT(activeCompilerHandles > 0);
@@ -140,7 +140,7 @@
 
     if (mComputeCompiler)
     {
-        ShDestruct(mComputeCompiler);
+        sh::Destruct(mComputeCompiler);
         mComputeCompiler = nullptr;
 
         ASSERT(activeCompilerHandles > 0);
@@ -149,7 +149,7 @@
 
     if (activeCompilerHandles == 0)
     {
-        ShFinalize();
+        sh::Finalize();
     }
 
     mImplementation->release();
@@ -181,10 +181,10 @@
     {
         if (activeCompilerHandles == 0)
         {
-            ShInitialize();
+            sh::Initialize();
         }
 
-        *compiler = ShConstructCompiler(type, mSpec, mOutputType, &mResources);
+        *compiler = sh::ConstructCompiler(type, mSpec, mOutputType, &mResources);
         activeCompilerHandles++;
     }
 
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index e008772..e65eb8e 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -266,17 +266,17 @@
     sourceCStrings.push_back(sourceString.c_str());
 
     bool result =
-        ShCompile(compilerHandle, &sourceCStrings[0], sourceCStrings.size(), compileOptions);
+        sh::Compile(compilerHandle, &sourceCStrings[0], sourceCStrings.size(), compileOptions);
 
     if (!result)
     {
-        mInfoLog = ShGetInfoLog(compilerHandle);
+        mInfoLog = sh::GetInfoLog(compilerHandle);
         TRACE("\n%s", mInfoLog.c_str());
         mCompiled = false;
         return;
     }
 
-    mState.mTranslatedSource = ShGetObjectCode(compilerHandle);
+    mState.mTranslatedSource = sh::GetObjectCode(compilerHandle);
 
 #ifndef NDEBUG
     // Prefix translated shader with commented out un-translated shader.
@@ -301,22 +301,22 @@
 #endif
 
     // Gather the shader information
-    mState.mShaderVersion = ShGetShaderVersion(compilerHandle);
+    mState.mShaderVersion = sh::GetShaderVersion(compilerHandle);
 
-    mState.mVaryings        = GetShaderVariables(ShGetVaryings(compilerHandle));
-    mState.mUniforms        = GetShaderVariables(ShGetUniforms(compilerHandle));
-    mState.mInterfaceBlocks = GetShaderVariables(ShGetInterfaceBlocks(compilerHandle));
+    mState.mVaryings        = GetShaderVariables(sh::GetVaryings(compilerHandle));
+    mState.mUniforms        = GetShaderVariables(sh::GetUniforms(compilerHandle));
+    mState.mInterfaceBlocks = GetShaderVariables(sh::GetInterfaceBlocks(compilerHandle));
 
     switch (mState.mShaderType)
     {
         case GL_COMPUTE_SHADER:
         {
-            mState.mLocalSize = ShGetComputeShaderLocalGroupSize(compilerHandle);
+            mState.mLocalSize = sh::GetComputeShaderLocalGroupSize(compilerHandle);
             break;
         }
         case GL_VERTEX_SHADER:
         {
-            mState.mActiveAttributes = GetActiveShaderVariables(ShGetAttributes(compilerHandle));
+            mState.mActiveAttributes = GetActiveShaderVariables(sh::GetAttributes(compilerHandle));
             break;
         }
         case GL_FRAGMENT_SHADER:
@@ -324,7 +324,7 @@
             // TODO(jmadill): Figure out why we only sort in the FS, and if we need to.
             std::sort(mState.mVaryings.begin(), mState.mVaryings.end(), CompareShaderVar);
             mState.mActiveOutputVariables =
-                GetActiveShaderVariables(ShGetOutputVariables(compilerHandle));
+                GetActiveShaderVariables(sh::GetOutputVariables(compilerHandle));
             break;
         }
         default:
diff --git a/src/libANGLE/renderer/ShaderImpl.h b/src/libANGLE/renderer/ShaderImpl.h
index 77f6e9b..77e02d0 100644
--- a/src/libANGLE/renderer/ShaderImpl.h
+++ b/src/libANGLE/renderer/ShaderImpl.h
@@ -21,7 +21,7 @@
     ShaderImpl(const gl::ShaderState &data) : mData(data) {}
     virtual ~ShaderImpl() { }
 
-    // Returns additional ShCompile options.
+    // Returns additional sh::Compile options.
     virtual ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
                                                            std::string *sourcePath) = 0;
     // Returns success for compiling on the driver. Returns success.
diff --git a/src/libANGLE/renderer/d3d/ShaderD3D.cpp b/src/libANGLE/renderer/d3d/ShaderD3D.cpp
index dea1520..fd7b13a 100644
--- a/src/libANGLE/renderer/d3d/ShaderD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ShaderD3D.cpp
@@ -201,7 +201,7 @@
 
     ShHandle compilerHandle = compiler->getCompilerHandle(mData.getShaderType());
 
-    mUniformRegisterMap = GetUniformRegisterMap(ShGetUniformRegisterMap(compilerHandle));
+    mUniformRegisterMap = GetUniformRegisterMap(sh::GetUniformRegisterMap(compilerHandle));
 
     for (const sh::InterfaceBlock &interfaceBlock : mData.getInterfaceBlocks())
     {
@@ -209,7 +209,7 @@
         {
             unsigned int index = static_cast<unsigned int>(-1);
             bool blockRegisterResult =
-                ShGetInterfaceBlockRegister(compilerHandle, interfaceBlock.name, &index);
+                sh::GetInterfaceBlockRegister(compilerHandle, interfaceBlock.name, &index);
             ASSERT(blockRegisterResult);
 
             mInterfaceBlockRegisterMap[interfaceBlock.name] = index;
diff --git a/src/libANGLE/renderer/null/ShaderNULL.h b/src/libANGLE/renderer/null/ShaderNULL.h
index f7d8971..d29b4cf 100644
--- a/src/libANGLE/renderer/null/ShaderNULL.h
+++ b/src/libANGLE/renderer/null/ShaderNULL.h
@@ -21,7 +21,7 @@
     ShaderNULL(const gl::ShaderState &data);
     ~ShaderNULL() override;
 
-    // Returns additional ShCompile options.
+    // Returns additional sh::Compile options.
     ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
                                                    std::string *sourcePath) override;
     // Returns success for compiling on the driver. Returns success.
diff --git a/src/libANGLE/renderer/vulkan/ShaderVk.h b/src/libANGLE/renderer/vulkan/ShaderVk.h
index 1d713ca..10f8fe4 100644
--- a/src/libANGLE/renderer/vulkan/ShaderVk.h
+++ b/src/libANGLE/renderer/vulkan/ShaderVk.h
@@ -21,7 +21,7 @@
     ShaderVk(const gl::ShaderState &data);
     ~ShaderVk() override;
 
-    // Returns additional ShCompile options.
+    // Returns additional sh::Compile options.
     ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
                                                    std::string *sourcePath) override;
     // Returns success for compiling on the driver. Returns success.
diff --git a/src/tests/angle_unittests_main.cpp b/src/tests/angle_unittests_main.cpp
index c52df14..1b44dbb 100644
--- a/src/tests/angle_unittests_main.cpp
+++ b/src/tests/angle_unittests_main.cpp
@@ -10,17 +10,17 @@
 class CompilerTestEnvironment : public testing::Environment
 {
   public:
-    virtual void SetUp()
+    void SetUp() override
     {
-        if (!ShInitialize())
+        if (!sh::Initialize())
         {
             FAIL() << "Failed to initialize the compiler.";
         }
     }
 
-    virtual void TearDown()
+    void TearDown() override
     {
-        if (!ShFinalize())
+        if (!sh::Finalize())
         {
             FAIL() << "Failed to finalize the compiler.";
         }
diff --git a/src/tests/compiler_tests/API_test.cpp b/src/tests/compiler_tests/API_test.cpp
index 217a260..090e31e 100644
--- a/src/tests/compiler_tests/API_test.cpp
+++ b/src/tests/compiler_tests/API_test.cpp
@@ -15,11 +15,11 @@
 {
     ShBuiltInResources a_resources;
     memset(&a_resources, 88, sizeof(a_resources));
-    ShInitBuiltInResources(&a_resources);
+    sh::InitBuiltInResources(&a_resources);
 
     ShBuiltInResources b_resources;
     memset(&b_resources, 77, sizeof(b_resources));
-    ShInitBuiltInResources(&b_resources);
+    sh::InitBuiltInResources(&b_resources);
 
     EXPECT_TRUE(memcmp(&a_resources, &b_resources, sizeof(a_resources)) == 0);
 }
diff --git a/src/tests/compiler_tests/CollectVariables_test.cpp b/src/tests/compiler_tests/CollectVariables_test.cpp
index f29374f..a934116 100644
--- a/src/tests/compiler_tests/CollectVariables_test.cpp
+++ b/src/tests/compiler_tests/CollectVariables_test.cpp
@@ -14,19 +14,21 @@
 #include "GLSLANG/ShaderLang.h"
 #include "compiler/translator/TranslatorGLSL.h"
 
+using namespace sh;
+
 #define EXPECT_GLENUM_EQ(expected, actual) \
-    EXPECT_EQ(static_cast<GLenum>(expected), static_cast<GLenum>(actual))
+    EXPECT_EQ(static_cast<::GLenum>(expected), static_cast<::GLenum>(actual))
 
 class CollectVariablesTest : public testing::Test
 {
   public:
-    CollectVariablesTest(GLenum shaderType) : mShaderType(shaderType) {}
+    CollectVariablesTest(::GLenum shaderType) : mShaderType(shaderType) {}
 
   protected:
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
         resources.MaxDrawBuffers = 8;
 
         initTranslator(resources);
@@ -45,10 +47,10 @@
         const char *shaderStrings[] = { shaderString.c_str() };
         ASSERT_TRUE(mTranslator->compile(shaderStrings, 1, SH_VARIABLES));
 
-        const std::vector<sh::Uniform> &uniforms = mTranslator->getUniforms();
+        const std::vector<Uniform> &uniforms = mTranslator->getUniforms();
         ASSERT_EQ(1u, uniforms.size());
 
-        const sh::Uniform &uniform = uniforms[0];
+        const Uniform &uniform = uniforms[0];
         EXPECT_EQ("gl_DepthRange", uniform.name);
         ASSERT_TRUE(uniform.isStruct());
         ASSERT_EQ(3u, uniform.fields.size());
@@ -90,7 +92,7 @@
     void validateOutputVariableForShader(const std::string &shaderString,
                                          unsigned int varIndex,
                                          const char *varName,
-                                         const sh::OutputVariable **outResult)
+                                         const OutputVariable **outResult)
     {
         const char *shaderStrings[] = {shaderString.c_str()};
         ASSERT_TRUE(mTranslator->compile(shaderStrings, 1, SH_VARIABLES))
@@ -98,7 +100,7 @@
 
         const auto &outputVariables = mTranslator->getOutputVariables();
         ASSERT_LT(varIndex, outputVariables.size());
-        const sh::OutputVariable &outputVariable = outputVariables[varIndex];
+        const OutputVariable &outputVariable = outputVariables[varIndex];
         EXPECT_EQ(-1, outputVariable.location);
         EXPECT_TRUE(outputVariable.staticUse);
         EXPECT_EQ(varName, outputVariable.name);
@@ -111,7 +113,7 @@
         ASSERT_TRUE(mTranslator->compile(shaderStrings, 1, SH_VARIABLES));
     }
 
-    GLenum mShaderType;
+    ::GLenum mShaderType;
     std::unique_ptr<TranslatorGLSL> mTranslator;
 };
 
@@ -142,7 +144,7 @@
     const auto &outputVariables = mTranslator->getOutputVariables();
     ASSERT_EQ(1u, outputVariables.size());
 
-    const sh::OutputVariable &outputVariable = outputVariables[0];
+    const OutputVariable &outputVariable = outputVariables[0];
 
     EXPECT_EQ(0u, outputVariable.arraySize);
     EXPECT_EQ(-1, outputVariable.location);
@@ -167,7 +169,7 @@
     const auto &outputVariables = mTranslator->getOutputVariables();
     ASSERT_EQ(1u, outputVariables.size());
 
-    const sh::OutputVariable &outputVariable = outputVariables[0];
+    const OutputVariable &outputVariable = outputVariables[0];
 
     EXPECT_EQ(0u, outputVariable.arraySize);
     EXPECT_EQ(5, outputVariable.location);
@@ -188,10 +190,10 @@
 
     compile(shaderString);
 
-    const std::vector<sh::Attribute> &attributes = mTranslator->getAttributes();
+    const std::vector<Attribute> &attributes = mTranslator->getAttributes();
     ASSERT_EQ(1u, attributes.size());
 
-    const sh::Attribute &attribute = attributes[0];
+    const Attribute &attribute = attributes[0];
 
     EXPECT_EQ(0u, attribute.arraySize);
     EXPECT_EQ(5, attribute.location);
@@ -214,20 +216,20 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_FALSE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("b", interfaceBlock.name);
     EXPECT_TRUE(interfaceBlock.staticUse);
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_GLENUM_EQ(GL_HIGH_FLOAT, field.precision);
     EXPECT_TRUE(field.staticUse);
@@ -250,21 +252,21 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_FALSE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("b", interfaceBlock.name);
     EXPECT_EQ("blockInstance", interfaceBlock.instanceName);
     EXPECT_TRUE(interfaceBlock.staticUse);
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_GLENUM_EQ(GL_HIGH_FLOAT, field.precision);
     EXPECT_TRUE(field.staticUse);
@@ -288,27 +290,27 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_FALSE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("b", interfaceBlock.name);
     EXPECT_TRUE(interfaceBlock.staticUse);
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_TRUE(field.isStruct());
     EXPECT_TRUE(field.staticUse);
     EXPECT_EQ("s", field.name);
     EXPECT_FALSE(field.isRowMajorLayout);
 
-    const sh::ShaderVariable &member = field.fields[0];
+    const ShaderVariable &member = field.fields[0];
 
     // NOTE: we don't currently mark struct members as statically used or not
     EXPECT_FALSE(member.isStruct());
@@ -331,28 +333,28 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_FALSE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("b", interfaceBlock.name);
     EXPECT_EQ("instanceName", interfaceBlock.instanceName);
     EXPECT_TRUE(interfaceBlock.staticUse);
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_TRUE(field.isStruct());
     EXPECT_TRUE(field.staticUse);
     EXPECT_EQ("s", field.name);
     EXPECT_FALSE(field.isRowMajorLayout);
 
-    const sh::ShaderVariable &member = field.fields[0];
+    const ShaderVariable &member = field.fields[0];
 
     // NOTE: we don't currently mark struct members as statically used or not
     EXPECT_FALSE(member.isStruct());
@@ -375,27 +377,27 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_TRUE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("b", interfaceBlock.name);
     EXPECT_TRUE(interfaceBlock.staticUse);
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_TRUE(field.isStruct());
     EXPECT_TRUE(field.staticUse);
     EXPECT_EQ("s", field.name);
     EXPECT_TRUE(field.isRowMajorLayout);
 
-    const sh::ShaderVariable &member = field.fields[0];
+    const ShaderVariable &member = field.fields[0];
 
     // NOTE: we don't currently mark struct members as statically used or not
     EXPECT_FALSE(member.isStruct());
@@ -417,10 +419,10 @@
 
     compile(shaderString);
 
-    const std::vector<sh::Varying> &varyings = mTranslator->getVaryings();
+    const std::vector<Varying> &varyings = mTranslator->getVaryings();
     ASSERT_EQ(2u, varyings.size());
 
-    const sh::Varying *varying = &varyings[0];
+    const Varying *varying = &varyings[0];
 
     if (varying->name == "gl_Position")
     {
@@ -432,7 +434,7 @@
     EXPECT_TRUE(varying->staticUse);
     EXPECT_GLENUM_EQ(GL_FLOAT, varying->type);
     EXPECT_EQ("vary", varying->name);
-    EXPECT_EQ(sh::INTERPOLATION_CENTROID, varying->interpolation);
+    EXPECT_EQ(INTERPOLATION_CENTROID, varying->interpolation);
 }
 
 // Test for builtin uniform "gl_DepthRange" (Vertex shader)
@@ -469,7 +471,7 @@
         "   gl_FragColor = vec4(1.0);\n"
         "}\n";
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(fragColorShader, 0u, "gl_FragColor", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(0u, outputVariable->arraySize);
@@ -495,7 +497,7 @@
     resources.MaxDrawBuffers = kMaxDrawBuffers;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(fragDataShader, 0u, "gl_FragData", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(kMaxDrawBuffers, outputVariable->arraySize);
@@ -518,7 +520,7 @@
     resources.EXT_frag_depth = 1;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(fragDepthShader, 0u, "gl_FragDepthEXT", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(0u, outputVariable->arraySize);
@@ -541,7 +543,7 @@
     resources.FragmentPrecisionHigh = 1;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(fragDepthHighShader, 0u, "gl_FragDepthEXT", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(0u, outputVariable->arraySize);
@@ -564,7 +566,7 @@
     resources.EXT_frag_depth = 1;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(fragDepthHighShader, 0u, "gl_FragDepth", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(0u, outputVariable->arraySize);
@@ -592,7 +594,7 @@
     resources.MaxDualSourceDrawBuffers = resources.MaxDrawBuffers;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(secondaryFragColorShader, 0u, "gl_FragColor", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(0u, outputVariable->arraySize);
@@ -630,7 +632,7 @@
     resources.MaxDualSourceDrawBuffers = resources.MaxDrawBuffers;
     initTranslator(resources);
 
-    const sh::OutputVariable *outputVariable = nullptr;
+    const OutputVariable *outputVariable = nullptr;
     validateOutputVariableForShader(secondaryFragDataShader, 0u, "gl_FragData", &outputVariable);
     ASSERT_NE(outputVariable, nullptr);
     EXPECT_EQ(kMaxDrawBuffers, outputVariable->arraySize);
@@ -658,7 +660,7 @@
     {
         // Initialize the translate with a hash function
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
         resources.HashFunction = SimpleTestHash;
         initTranslator(resources);
     }
@@ -677,14 +679,14 @@
 
     compile(shaderString);
 
-    const std::vector<sh::InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
+    const std::vector<InterfaceBlock> &interfaceBlocks = mTranslator->getInterfaceBlocks();
     ASSERT_EQ(1u, interfaceBlocks.size());
 
-    const sh::InterfaceBlock &interfaceBlock = interfaceBlocks[0];
+    const InterfaceBlock &interfaceBlock = interfaceBlocks[0];
 
     EXPECT_EQ(0u, interfaceBlock.arraySize);
     EXPECT_FALSE(interfaceBlock.isRowMajorLayout);
-    EXPECT_EQ(sh::BLOCKLAYOUT_SHARED, interfaceBlock.layout);
+    EXPECT_EQ(BLOCKLAYOUT_SHARED, interfaceBlock.layout);
     EXPECT_EQ("blockName", interfaceBlock.name);
     EXPECT_EQ("blockInstance", interfaceBlock.instanceName);
     EXPECT_EQ("webgl_9", interfaceBlock.mappedName);
@@ -692,7 +694,7 @@
 
     ASSERT_EQ(1u, interfaceBlock.fields.size());
 
-    const sh::InterfaceBlockField &field = interfaceBlock.fields[0];
+    const InterfaceBlockField &field = interfaceBlock.fields[0];
 
     EXPECT_GLENUM_EQ(GL_HIGH_FLOAT, field.precision);
     EXPECT_TRUE(field.staticUse);
@@ -720,7 +722,7 @@
     const auto &uniforms = mTranslator->getUniforms();
     ASSERT_EQ(1u, uniforms.size());
 
-    const sh::Uniform &uniform = uniforms[0];
+    const Uniform &uniform = uniforms[0];
 
     EXPECT_EQ(0u, uniform.arraySize);
     EXPECT_EQ("u", uniform.name);
@@ -729,7 +731,7 @@
 
     ASSERT_EQ(1u, uniform.fields.size());
 
-    const sh::ShaderVariable &field = uniform.fields[0];
+    const ShaderVariable &field = uniform.fields[0];
 
     EXPECT_GLENUM_EQ(GL_HIGH_FLOAT, field.precision);
     // EXPECT_TRUE(field.staticUse); // we don't yet support struct static use
diff --git a/src/tests/compiler_tests/ConstantFolding_test.cpp b/src/tests/compiler_tests/ConstantFolding_test.cpp
index e132e63..084c94e 100644
--- a/src/tests/compiler_tests/ConstantFolding_test.cpp
+++ b/src/tests/compiler_tests/ConstantFolding_test.cpp
@@ -15,6 +15,8 @@
 #include "compiler/translator/PoolAlloc.h"
 #include "compiler/translator/TranslatorESSL.h"
 
+using namespace sh;
+
 template <typename T>
 class ConstantFinder : public TIntermTraverser
 {
@@ -107,7 +109,7 @@
         allocator.push();
         SetGlobalPoolAllocator(&allocator);
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
 
         mTranslatorESSL = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_GLES3_SPEC);
         ASSERT_TRUE(mTranslatorESSL->Init(resources));
diff --git a/src/tests/compiler_tests/DebugShaderPrecision_test.cpp b/src/tests/compiler_tests/DebugShaderPrecision_test.cpp
index 424cb8b..9b163a8 100644
--- a/src/tests/compiler_tests/DebugShaderPrecision_test.cpp
+++ b/src/tests/compiler_tests/DebugShaderPrecision_test.cpp
@@ -1037,7 +1037,7 @@
     std::string infoLog;
     std::string translatedCode;
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
     resources.WEBGL_debug_shader_precision = 1;
     ASSERT_FALSE(compileTestShader(GL_FRAGMENT_SHADER, SH_GLES3_SPEC, SH_HLSL_3_0_OUTPUT,
                                    shaderString, &resources, 0, &translatedCode, &infoLog));
diff --git a/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp b/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp
index 40aeed2..3ac0ff6 100644
--- a/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp
+++ b/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp
@@ -124,7 +124,7 @@
   protected:
     virtual void SetUp()
     {
-        ShInitBuiltInResources(&mResources);
+        sh::InitBuiltInResources(&mResources);
         // EXT_draw_buffers is used in some of the shaders for test purposes.
         mResources.EXT_draw_buffers = 1;
         mResources.NV_draw_buffers  = 2;
@@ -137,7 +137,7 @@
     {
         if (mCompiler)
         {
-            ShDestruct(mCompiler);
+            sh::Destruct(mCompiler);
             mCompiler = NULL;
         }
     }
@@ -145,8 +145,8 @@
     void InitializeCompiler()
     {
         DestroyCompiler();
-        mCompiler = ShConstructCompiler(GL_FRAGMENT_SHADER, testing::get<0>(GetParam()),
-                                        SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
+        mCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, testing::get<0>(GetParam()),
+                                          SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
         ASSERT_TRUE(mCompiler != NULL) << "Compiler could not be constructed.";
     }
 
@@ -163,12 +163,12 @@
                                                const char *shader)
     {
         const char *shaderStrings[] = {version, pragma, shader};
-        bool success = ShCompile(mCompiler, shaderStrings, 3, 0);
+        bool success                = sh::Compile(mCompiler, shaderStrings, 3, 0);
         if (success)
         {
             return ::testing::AssertionSuccess() << "Compilation success";
         }
-        return ::testing::AssertionFailure() << ShGetInfoLog(mCompiler);
+        return ::testing::AssertionFailure() << sh::GetInfoLog(mCompiler);
     }
 
   protected:
diff --git a/src/tests/compiler_tests/ExpressionLimit_test.cpp b/src/tests/compiler_tests/ExpressionLimit_test.cpp
index f2a24a5..8f7d7ef 100644
--- a/src/tests/compiler_tests/ExpressionLimit_test.cpp
+++ b/src/tests/compiler_tests/ExpressionLimit_test.cpp
@@ -32,7 +32,7 @@
     // Set up the per compile resources
     static void GenerateResources(ShBuiltInResources *res)
     {
-        ShInitBuiltInResources(res);
+        sh::InitBuiltInResources(res);
 
         res->MaxVertexAttribs             = 8;
         res->MaxVertexUniformVectors      = 128;
@@ -179,14 +179,14 @@
                                 ShCompileOptions compileOptions,
                                 const char *expected_error)
     {
-        bool success = ShCompile(compiler, &source, 1, compileOptions) != 0;
-        if (success)
-        {
-            success = !expected_error;
+                bool success = sh::Compile(compiler, &source, 1, compileOptions) != 0;
+                if (success)
+                {
+                    success = !expected_error;
         }
         else
         {
-            std::string log = ShGetInfoLog(compiler);
+            std::string log = sh::GetInfoLog(compiler);
             if (expected_error)
                 success = log.find(expected_error) != std::string::npos;
 
@@ -211,8 +211,7 @@
 {
     ShShaderSpec spec = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle vertexCompiler = ShConstructCompiler(
-        GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle vertexCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test expression under the limit passes.
@@ -233,15 +232,14 @@
         GenerateShaderWithLongExpression(
             kMaxExpressionComplexity + 10).c_str(),
         compileOptions & ~SH_LIMIT_EXPRESSION_COMPLEXITY, NULL));
-    ShDestruct(vertexCompiler);
+    sh::Destruct(vertexCompiler);
 }
 
 TEST_F(ExpressionLimitTest, UnusedExpressionComplexity)
 {
     ShShaderSpec spec = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle vertexCompiler = ShConstructCompiler(
-        GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle vertexCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test expression under the limit passes.
@@ -262,15 +260,14 @@
         GenerateShaderWithUnusedLongExpression(
             kMaxExpressionComplexity + 10).c_str(),
         compileOptions & ~SH_LIMIT_EXPRESSION_COMPLEXITY, NULL));
-    ShDestruct(vertexCompiler);
+    sh::Destruct(vertexCompiler);
 }
 
 TEST_F(ExpressionLimitTest, CallStackDepth)
 {
     ShShaderSpec spec = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle vertexCompiler = ShConstructCompiler(
-        GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle vertexCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
 
     // Test call stack under the limit passes.
@@ -291,15 +288,14 @@
         GenerateShaderWithDeepFunctionStack(
             kMaxCallStackDepth + 10).c_str(),
         compileOptions & ~SH_LIMIT_CALL_STACK_DEPTH, NULL));
-    ShDestruct(vertexCompiler);
+    sh::Destruct(vertexCompiler);
 }
 
 TEST_F(ExpressionLimitTest, UnusedCallStackDepth)
 {
     ShShaderSpec spec = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle vertexCompiler = ShConstructCompiler(
-        GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle vertexCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
 
     // Test call stack under the limit passes.
@@ -320,15 +316,14 @@
         GenerateShaderWithUnusedDeepFunctionStack(
             kMaxCallStackDepth + 10).c_str(),
         compileOptions & ~SH_LIMIT_CALL_STACK_DEPTH, NULL));
-    ShDestruct(vertexCompiler);
+    sh::Destruct(vertexCompiler);
 }
 
 TEST_F(ExpressionLimitTest, Recursion)
 {
     ShShaderSpec spec = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle vertexCompiler = ShConstructCompiler(
-        GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle vertexCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = 0;
 
     static const char* shaderWithRecursion0 = SHADER(
@@ -536,14 +531,14 @@
     EXPECT_TRUE(CheckShaderCompilation(
         vertexCompiler, shaderWithNoRecursion,
         compileOptions | SH_LIMIT_CALL_STACK_DEPTH, NULL));
-    ShDestruct(vertexCompiler);
+    sh::Destruct(vertexCompiler);
 }
 
 TEST_F(ExpressionLimitTest, FunctionParameterCount)
 {
     ShShaderSpec spec     = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
-    ShHandle compiler     = ShConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
+    ShHandle compiler     = sh::ConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
     ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test parameters under the limit succeeds.
@@ -558,5 +553,5 @@
     EXPECT_TRUE(CheckShaderCompilation(
         compiler, GenerateShaderWithFunctionParameters(kMaxFunctionParameters + 1).c_str(),
         compileOptions & ~SH_LIMIT_EXPRESSION_COMPLEXITY, nullptr));
-    ShDestruct(compiler);
+    sh::Destruct(compiler);
 }
diff --git a/src/tests/compiler_tests/FragDepth_test.cpp b/src/tests/compiler_tests/FragDepth_test.cpp
index d3c8798..1d3e358 100644
--- a/src/tests/compiler_tests/FragDepth_test.cpp
+++ b/src/tests/compiler_tests/FragDepth_test.cpp
@@ -23,7 +23,7 @@
   protected:
     void SetUp() override
     {
-        ShInitBuiltInResources(&mResources);
+        sh::InitBuiltInResources(&mResources);
         mCompiler                 = nullptr;
         mResources.EXT_frag_depth = GetParam();
     }
@@ -33,7 +33,7 @@
     {
         if (mCompiler)
         {
-            ShDestruct(mCompiler);
+            sh::Destruct(mCompiler);
             mCompiler = nullptr;
         }
     }
@@ -41,8 +41,8 @@
     void InitializeCompiler()
     {
         DestroyCompiler();
-        mCompiler = ShConstructCompiler(GL_FRAGMENT_SHADER, SH_GLES3_SPEC,
-                                        SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
+        mCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_GLES3_SPEC,
+                                          SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
         ASSERT_TRUE(mCompiler != nullptr) << "Compiler could not be constructed.";
     }
 
@@ -51,12 +51,12 @@
                                                const char *shader)
     {
         const char *shaderStrings[] = {version, pragma, shader};
-        bool success = ShCompile(mCompiler, shaderStrings, 3, 0);
+        bool success                = sh::Compile(mCompiler, shaderStrings, 3, 0);
         if (success)
         {
             return ::testing::AssertionSuccess() << "Compilation success";
         }
-        return ::testing::AssertionFailure() << ShGetInfoLog(mCompiler);
+        return ::testing::AssertionFailure() << sh::GetInfoLog(mCompiler);
     }
 
   protected:
diff --git a/src/tests/compiler_tests/MalformedShader_test.cpp b/src/tests/compiler_tests/MalformedShader_test.cpp
index 56d479d..8f7bbb4 100644
--- a/src/tests/compiler_tests/MalformedShader_test.cpp
+++ b/src/tests/compiler_tests/MalformedShader_test.cpp
@@ -12,6 +12,8 @@
 #include "GLSLANG/ShaderLang.h"
 #include "compiler/translator/TranslatorESSL.h"
 
+using namespace sh;
+
 class MalformedShaderTest : public testing::Test
 {
   public:
@@ -21,7 +23,7 @@
     virtual void SetUp()
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_GLES3_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
@@ -63,7 +65,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_VERTEX_SHADER, SH_GLES3_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
@@ -79,7 +81,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_WEBGL2_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
@@ -95,7 +97,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
@@ -111,7 +113,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
         mTranslator = new TranslatorESSL(GL_VERTEX_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
     }
@@ -126,7 +128,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
         mTranslator = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
     }
@@ -141,7 +143,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
         mTranslator = new TranslatorESSL(GL_COMPUTE_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
     }
diff --git a/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp b/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp
index 6f53b68..dd3aa9a 100644
--- a/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp
+++ b/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp
@@ -14,6 +14,8 @@
 #include "GLSLANG/ShaderLang.h"
 #include "tests/test_utils/compiler_test.h"
 
+using namespace sh;
+
 class QualificationVertexShaderTestESSL31 : public testing::Test
 {
   public:
@@ -22,7 +24,7 @@
     virtual void SetUp()
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_VERTEX_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
diff --git a/src/tests/compiler_tests/QualificationOrder_test.cpp b/src/tests/compiler_tests/QualificationOrder_test.cpp
index 928a707..33ecbf7 100644
--- a/src/tests/compiler_tests/QualificationOrder_test.cpp
+++ b/src/tests/compiler_tests/QualificationOrder_test.cpp
@@ -12,6 +12,8 @@
 #include "GLSLANG/ShaderLang.h"
 #include "compiler/translator/TranslatorESSL.h"
 
+using namespace sh;
+
 class QualificationOrderShaderTest : public testing::Test
 {
   public:
@@ -23,10 +25,10 @@
     virtual void TearDown() {}
 
     // Return true when compilation succeeds
-    bool compile(const std::string &shaderString, GLenum shaderType, ShShaderSpec spec)
+    bool compile(const std::string &shaderString, ::GLenum shaderType, ShShaderSpec spec)
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
         resources.MaxDrawBuffers = (spec == SH_GLES2_SPEC) ? 1 : 8;
 
         TranslatorESSL *translator = new TranslatorESSL(shaderType, spec);
diff --git a/src/tests/compiler_tests/RemovePow_test.cpp b/src/tests/compiler_tests/RemovePow_test.cpp
index 2434f09..affd0d1 100644
--- a/src/tests/compiler_tests/RemovePow_test.cpp
+++ b/src/tests/compiler_tests/RemovePow_test.cpp
@@ -24,8 +24,9 @@
         allocator.push();
         SetGlobalPoolAllocator(&allocator);
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
-        mTranslatorGLSL = new TranslatorGLSL(GL_FRAGMENT_SHADER, SH_GLES2_SPEC, SH_GLSL_COMPATIBILITY_OUTPUT);
+        sh::InitBuiltInResources(&resources);
+        mTranslatorGLSL =
+            new sh::TranslatorGLSL(GL_FRAGMENT_SHADER, SH_GLES2_SPEC, SH_GLSL_COMPATIBILITY_OUTPUT);
         ASSERT_TRUE(mTranslatorGLSL->Init(resources));
     }
 
@@ -55,7 +56,7 @@
     }
 
   private:
-    TranslatorGLSL *mTranslatorGLSL;
+    sh::TranslatorGLSL *mTranslatorGLSL;
     TIntermNode *mASTRoot;
 
     TPoolAllocator allocator;
diff --git a/src/tests/compiler_tests/ShCompile_test.cpp b/src/tests/compiler_tests/ShCompile_test.cpp
index 2a514a9..21e4a3c 100644
--- a/src/tests/compiler_tests/ShCompile_test.cpp
+++ b/src/tests/compiler_tests/ShCompile_test.cpp
@@ -4,7 +4,7 @@
 // found in the LICENSE file.
 //
 // ShCompile_test.cpp
-//   Test the ShCompile interface with different parameters.
+//   Test the sh::Compile interface with different parameters.
 //
 
 #include "angle_gl.h"
@@ -19,9 +19,9 @@
   protected:
     void SetUp() override
     {
-        ShInitBuiltInResources(&mResources);
-        mCompiler = ShConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,
-                                        SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
+        sh::InitBuiltInResources(&mResources);
+        mCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,
+                                          SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
         ASSERT_TRUE(mCompiler != nullptr) << "Compiler could not be constructed.";
     }
 
@@ -29,15 +29,15 @@
     {
         if (mCompiler)
         {
-            ShDestruct(mCompiler);
+            sh::Destruct(mCompiler);
             mCompiler = nullptr;
         }
     }
 
     void testCompile(const char **shaderStrings, int stringCount, bool expectation)
     {
-        bool success                  = ShCompile(mCompiler, shaderStrings, stringCount, 0);
-        const std::string &compileLog = ShGetInfoLog(mCompiler);
+        bool success                  = sh::Compile(mCompiler, shaderStrings, stringCount, 0);
+        const std::string &compileLog = sh::GetInfoLog(mCompiler);
         EXPECT_EQ(expectation, success) << compileLog;
     }
 
@@ -46,7 +46,7 @@
     ShHandle mCompiler;
 };
 
-// Test calling ShCompile with more than one shader source string.
+// Test calling sh::Compile with more than one shader source string.
 TEST_F(ShCompileTest, MultipleShaderStrings)
 {
     const std::string &shaderString1 =
@@ -61,7 +61,7 @@
     testCompile(shaderStrings, 2, true);
 }
 
-// Test calling ShCompile with a tokens split into different shader source strings.
+// Test calling sh::Compile with a tokens split into different shader source strings.
 TEST_F(ShCompileTest, TokensSplitInShaderStrings)
 {
     const std::string &shaderString1 =
diff --git a/src/tests/compiler_tests/ShaderExtension_test.cpp b/src/tests/compiler_tests/ShaderExtension_test.cpp
index a23de3d..eb2d9b9 100644
--- a/src/tests/compiler_tests/ShaderExtension_test.cpp
+++ b/src/tests/compiler_tests/ShaderExtension_test.cpp
@@ -52,7 +52,7 @@
   protected:
     virtual void SetUp()
     {
-        ShInitBuiltInResources(&mResources);
+        sh::InitBuiltInResources(&mResources);
         mCompiler = NULL;
     }
 
@@ -65,7 +65,7 @@
     {
         if (mCompiler)
         {
-            ShDestruct(mCompiler);
+            sh::Destruct(mCompiler);
             mCompiler = NULL;
         }
     }
@@ -73,15 +73,15 @@
     void InitializeCompiler()
     {
         DestroyCompiler();
-        mCompiler = ShConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,
-                                        SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
+        mCompiler = sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL_SPEC,
+                                          SH_GLSL_COMPATIBILITY_OUTPUT, &mResources);
         ASSERT_TRUE(mCompiler != NULL) << "Compiler could not be constructed.";
     }
 
     void TestShaderExtension(const char **shaderStrings, int stringCount, bool expectation)
     {
-        bool success = ShCompile(mCompiler, shaderStrings, stringCount, 0);
-        const std::string& compileLog = ShGetInfoLog(mCompiler);
+        bool success                  = sh::Compile(mCompiler, shaderStrings, stringCount, 0);
+        const std::string &compileLog = sh::GetInfoLog(mCompiler);
         EXPECT_EQ(expectation, success) << compileLog;
     }
 
diff --git a/src/tests/compiler_tests/ShaderImage_test.cpp b/src/tests/compiler_tests/ShaderImage_test.cpp
index 5ff40df..a22c7e4 100644
--- a/src/tests/compiler_tests/ShaderImage_test.cpp
+++ b/src/tests/compiler_tests/ShaderImage_test.cpp
@@ -112,9 +112,9 @@
     virtual void SetUp()
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        sh::InitBuiltInResources(&resources);
 
-        mTranslator = new TranslatorESSL(GL_COMPUTE_SHADER, SH_GLES3_1_SPEC);
+        mTranslator = new sh::TranslatorESSL(GL_COMPUTE_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
     }
 
@@ -134,7 +134,7 @@
   protected:
     std::string mTranslatedCode;
     std::string mInfoLog;
-    TranslatorESSL *mTranslator;
+    sh::TranslatorESSL *mTranslator;
     TIntermNode *mASTRoot;
 };
 
diff --git a/src/tests/compiler_tests/ShaderVariable_test.cpp b/src/tests/compiler_tests/ShaderVariable_test.cpp
index 6b90f1f..53dd93f 100644
--- a/src/tests/compiler_tests/ShaderVariable_test.cpp
+++ b/src/tests/compiler_tests/ShaderVariable_test.cpp
@@ -229,10 +229,10 @@
 TEST(ShaderVariableTest, InvariantDoubleDeleteBug)
 {
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
 
-    ShHandle compiler = ShConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
-                                            SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
+    ShHandle compiler = sh::ConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+                                              SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
     EXPECT_NE(static_cast<ShHandle>(0), compiler);
 
     const char *program[] =
@@ -246,18 +246,18 @@
         "}"
     };
 
-    EXPECT_TRUE(ShCompile(compiler, program, 1, SH_OBJECT_CODE));
-    EXPECT_TRUE(ShCompile(compiler, program, 1, SH_OBJECT_CODE));
-    ShDestruct(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program, 1, SH_OBJECT_CODE));
+    EXPECT_TRUE(sh::Compile(compiler, program, 1, SH_OBJECT_CODE));
+    sh::Destruct(compiler);
 }
 
 TEST(ShaderVariableTest, IllegalInvariantVarying)
 {
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
 
-    ShHandle compiler = ShConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
-                                            SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
+    ShHandle compiler = sh::ConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+                                              SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
     EXPECT_NE(static_cast<ShHandle>(0), compiler);
 
     const char *program1[] =
@@ -284,17 +284,17 @@
         "}"
     };
 
-    EXPECT_TRUE(ShCompile(compiler, program1, 1, SH_VARIABLES));
-    EXPECT_FALSE(ShCompile(compiler, program2, 1, SH_VARIABLES));
+    EXPECT_TRUE(sh::Compile(compiler, program1, 1, SH_VARIABLES));
+    EXPECT_FALSE(sh::Compile(compiler, program2, 1, SH_VARIABLES));
 }
 
 TEST(ShaderVariableTest, InvariantLeakAcrossShaders)
 {
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
 
-    ShHandle compiler = ShConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
-                                            SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
+    ShHandle compiler = sh::ConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+                                              SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
     EXPECT_NE(static_cast<ShHandle>(0), compiler);
 
     const char *program1[] =
@@ -313,15 +313,15 @@
         "}"
     };
 
-    EXPECT_TRUE(ShCompile(compiler, program1, 1, SH_VARIABLES));
-    const std::vector<sh::Varying> *varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program1, 1, SH_VARIABLES));
+    const std::vector<sh::Varying> *varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "v_varying")
             EXPECT_TRUE(varying.isInvariant);
     }
-    EXPECT_TRUE(ShCompile(compiler, program2, 1, SH_VARIABLES));
-    varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program2, 1, SH_VARIABLES));
+    varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "v_varying")
@@ -332,10 +332,10 @@
 TEST(ShaderVariableTest, GlobalInvariantLeakAcrossShaders)
 {
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
 
-    ShHandle compiler = ShConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
-                                            SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
+    ShHandle compiler = sh::ConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+                                              SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
     EXPECT_NE(static_cast<ShHandle>(0), compiler);
 
     const char *program1[] =
@@ -354,15 +354,15 @@
         "}"
     };
 
-    EXPECT_TRUE(ShCompile(compiler, program1, 1, SH_VARIABLES));
-    const std::vector<sh::Varying> *varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program1, 1, SH_VARIABLES));
+    const std::vector<sh::Varying> *varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "v_varying")
             EXPECT_TRUE(varying.isInvariant);
     }
-    EXPECT_TRUE(ShCompile(compiler, program2, 1, SH_VARIABLES));
-    varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program2, 1, SH_VARIABLES));
+    varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "v_varying")
@@ -374,10 +374,10 @@
 {
 
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
 
-    ShHandle compiler = ShConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
-                                            SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
+    ShHandle compiler = sh::ConstructCompiler(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+                                              SH_GLSL_COMPATIBILITY_OUTPUT, &resources);
     EXPECT_NE(static_cast<ShHandle>(0), compiler);
 
     const char *program1[] =
@@ -401,21 +401,21 @@
         "}"
     };
 
-    EXPECT_TRUE(ShCompile(compiler, program1, 1, SH_VARIABLES));
-    const std::vector<sh::Varying> *varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program1, 1, SH_VARIABLES));
+    const std::vector<sh::Varying> *varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "gl_Position")
             EXPECT_TRUE(varying.isInvariant);
     }
-    EXPECT_TRUE(ShCompile(compiler, program2, 1, SH_VARIABLES));
-    varyings = ShGetVaryings(compiler);
+    EXPECT_TRUE(sh::Compile(compiler, program2, 1, SH_VARIABLES));
+    varyings = sh::GetVaryings(compiler);
     for (const sh::Varying &varying : *varyings)
     {
         if (varying.name == "gl_Position")
             EXPECT_FALSE(varying.isInvariant);
     }
-    EXPECT_FALSE(ShCompile(compiler, program3, 1, SH_VARIABLES));
+    EXPECT_FALSE(sh::Compile(compiler, program3, 1, SH_VARIABLES));
 }
 
 }  // namespace sh
diff --git a/src/tests/compiler_tests/TypeTracking_test.cpp b/src/tests/compiler_tests/TypeTracking_test.cpp
index 00f05fb..ac8ee70 100644
--- a/src/tests/compiler_tests/TypeTracking_test.cpp
+++ b/src/tests/compiler_tests/TypeTracking_test.cpp
@@ -13,26 +13,25 @@
 #include "GLSLANG/ShaderLang.h"
 #include "compiler/translator/TranslatorESSL.h"
 
+using namespace sh;
+
 class TypeTrackingTest : public testing::Test
 {
   public:
     TypeTrackingTest() {}
 
   protected:
-    virtual void SetUp()
+    void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
         resources.FragmentPrecisionHigh = 1;
 
         mTranslator = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_GLES3_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
     }
 
-    virtual void TearDown()
-    {
-        delete mTranslator;
-    }
+    void TearDown() override { delete mTranslator; }
 
     void compile(const std::string& shaderString)
     {
diff --git a/src/tests/compiler_tests/WorkGroupSize_test.cpp b/src/tests/compiler_tests/WorkGroupSize_test.cpp
index f2a9d4e..980617f 100644
--- a/src/tests/compiler_tests/WorkGroupSize_test.cpp
+++ b/src/tests/compiler_tests/WorkGroupSize_test.cpp
@@ -13,6 +13,8 @@
 #include "compiler/translator/TranslatorESSL.h"
 #include "tests/test_utils/compiler_test.h"
 
+using namespace sh;
+
 class WorkGroupSizeTest : public testing::Test
 {
   public:
@@ -22,7 +24,7 @@
     void SetUp() override
     {
         ShBuiltInResources resources;
-        ShInitBuiltInResources(&resources);
+        InitBuiltInResources(&resources);
 
         mTranslator = new TranslatorESSL(GL_COMPUTE_SHADER, SH_GLES3_1_SPEC);
         ASSERT_TRUE(mTranslator->Init(resources));
@@ -56,7 +58,7 @@
 
     compile(shaderString);
 
-    const sh::WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
+    const WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
     ASSERT_EQ(5, localSize[0]);
     ASSERT_EQ(1, localSize[1]);
     ASSERT_EQ(1, localSize[2]);
@@ -73,7 +75,7 @@
 
     compile(shaderString);
 
-    const sh::WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
+    const WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
     ASSERT_EQ(5, localSize[0]);
     ASSERT_EQ(1, localSize[1]);
     ASSERT_EQ(10, localSize[2]);
@@ -90,7 +92,7 @@
 
     compile(shaderString);
 
-    const sh::WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
+    const WorkGroupSize &localSize = mTranslator->getComputeShaderLocalSize();
     ASSERT_EQ(5, localSize[0]);
     ASSERT_EQ(15, localSize[1]);
     ASSERT_EQ(10, localSize[2]);
diff --git a/src/tests/test_utils/compiler_test.cpp b/src/tests/test_utils/compiler_test.cpp
index ff35848..9efe38a 100644
--- a/src/tests/test_utils/compiler_test.cpp
+++ b/src/tests/test_utils/compiler_test.cpp
@@ -80,7 +80,7 @@
                        std::string *translatedCode,
                        std::string *infoLog)
 {
-    TCompiler *translator = ConstructCompiler(type, spec, output);
+    sh::TCompiler *translator = sh::ConstructCompiler(type, spec, output);
     if (!translator->Init(*resources))
     {
         SafeDelete(translator);
@@ -108,7 +108,7 @@
                        std::string *infoLog)
 {
     ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
+    sh::InitBuiltInResources(&resources);
     return compileTestShader(type, spec, output, shaderString, &resources, compileOptions, translatedCode, infoLog);
 }
 
@@ -117,7 +117,7 @@
                                          ShShaderOutput outputType)
     : mShaderType(shaderType), mDefaultCompileOptions(defaultCompileOptions)
 {
-    ShInitBuiltInResources(&mResources);
+    sh::InitBuiltInResources(&mResources);
     mOutputCode[outputType] = std::string();
 }