Use 64-bits compile options

BUG=chromium:645071

Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff
Reviewed-on: https://chromium-review.googlesource.com/382712
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 484b899..ddeb05a 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -154,7 +154,7 @@
 {
 }
 
-bool TCompiler::shouldRunLoopAndIndexingValidation(int compileOptions) const
+bool TCompiler::shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptions) const
 {
     // If compiling an ESSL 1.00 shader for WebGL, or if its been requested through the API,
     // validate loop and indexing as well (to verify that the shader only uses minimal functionality
@@ -189,15 +189,16 @@
     return true;
 }
 
-TIntermNode *TCompiler::compileTreeForTesting(const char* const shaderStrings[],
-    size_t numStrings, int compileOptions)
+TIntermNode *TCompiler::compileTreeForTesting(const char *const shaderStrings[],
+                                              size_t numStrings,
+                                              ShCompileOptions compileOptions)
 {
     return compileTreeImpl(shaderStrings, numStrings, compileOptions);
 }
 
 TIntermNode *TCompiler::compileTreeImpl(const char *const shaderStrings[],
                                         size_t numStrings,
-                                        const int compileOptions)
+                                        const ShCompileOptions compileOptions)
 {
     clearResults();
 
@@ -393,12 +394,14 @@
     return NULL;
 }
 
-bool TCompiler::compile(const char *const shaderStrings[], size_t numStrings, int compileOptionsIn)
+bool TCompiler::compile(const char *const shaderStrings[],
+                        size_t numStrings,
+                        ShCompileOptions compileOptionsIn)
 {
     if (numStrings == 0)
         return true;
 
-    int compileOptions = compileOptionsIn;
+    ShCompileOptions compileOptions = compileOptionsIn;
 
     // Apply key workarounds.
     if (shouldFlattenPragmaStdglInvariantAll())
@@ -852,7 +855,7 @@
     return builtInFunctionEmulator;
 }
 
-void TCompiler::writePragma(int compileOptions)
+void TCompiler::writePragma(ShCompileOptions compileOptions)
 {
     if (!(compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL))
     {
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index 3f22bd6..ace1abb 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -73,11 +73,13 @@
     // compileTreeForTesting should be used only when tests require access to
     // the AST. Users of this function need to manually manage the global pool
     // allocator. Returns NULL whenever there are compilation errors.
-    TIntermNode *compileTreeForTesting(const char* const shaderStrings[],
-        size_t numStrings, int compileOptions);
+    TIntermNode *compileTreeForTesting(const char *const shaderStrings[],
+                                       size_t numStrings,
+                                       ShCompileOptions compileOptions);
 
-    bool compile(const char* const shaderStrings[],
-        size_t numStrings, int compileOptions);
+    bool compile(const char *const shaderStrings[],
+                 size_t numStrings,
+                 ShCompileOptions compileOptions);
 
     // Get results of the last compilation.
     int getShaderVersion() const { return shaderVersion; }
@@ -102,7 +104,7 @@
     ShShaderOutput getOutputType() const { return outputType; }
     const std::string &getBuiltInResourcesString() const { return builtInResourcesString; }
 
-    bool shouldRunLoopAndIndexingValidation(int compileOptions) const;
+    bool shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptions) const;
 
     // Get the resources set by InitBuiltInSymbolTable
     const ShBuiltInResources& getResources() const;
@@ -123,9 +125,10 @@
     // Collect info for all attribs, uniforms, varyings.
     void collectVariables(TIntermNode* root);
     // Add emulated functions to the built-in function emulator.
-    virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) {};
+    virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
+                                             ShCompileOptions compileOptions){};
     // Translate to object code.
-    virtual void translate(TIntermNode *root, int compileOptions) = 0;
+    virtual void translate(TIntermNode *root, ShCompileOptions compileOptions) = 0;
     // Returns true if, after applying the packing rules in the GLSL 1.017 spec
     // Appendix A, section 7, the shader does not use too many uniforms.
     bool enforcePackingRestrictions();
@@ -143,7 +146,7 @@
     const TExtensionBehavior& getExtensionBehavior() const;
     const char *getSourcePath() const;
     const TPragma& getPragma() const { return mPragma; }
-    void writePragma(int compileOptions);
+    void writePragma(ShCompileOptions compileOptions);
     unsigned int *getTemporaryIndex() { return &mTemporaryIndex; }
     // Relies on collectVariables having been called.
     bool isVaryingDefined(const char *varyingName);
@@ -152,7 +155,7 @@
     ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
     const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
 
-    virtual bool shouldCollectVariables(int compileOptions)
+    virtual bool shouldCollectVariables(ShCompileOptions compileOptions)
     {
         return (compileOptions & SH_VARIABLES) != 0;
     }
@@ -182,7 +185,7 @@
 
     TIntermNode *compileTreeImpl(const char *const shaderStrings[],
                                  size_t numStrings,
-                                 const int compileOptions);
+                                 const ShCompileOptions compileOptions);
 
     sh::GLenum shaderType;
     ShShaderSpec shaderSpec;
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 9d77da2..ce14d3c 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -80,11 +80,14 @@
 namespace sh
 {
 
-OutputHLSL::OutputHLSL(sh::GLenum shaderType, int shaderVersion,
-    const TExtensionBehavior &extensionBehavior,
-    const char *sourcePath, ShShaderOutput outputType,
-    int numRenderTargets, const std::vector<Uniform> &uniforms,
-    int compileOptions)
+OutputHLSL::OutputHLSL(sh::GLenum shaderType,
+                       int shaderVersion,
+                       const TExtensionBehavior &extensionBehavior,
+                       const char *sourcePath,
+                       ShShaderOutput outputType,
+                       int numRenderTargets,
+                       const std::vector<Uniform> &uniforms,
+                       ShCompileOptions compileOptions)
     : TIntermTraverser(true, true, true),
       mShaderType(shaderType),
       mShaderVersion(shaderVersion),
diff --git a/src/compiler/translator/OutputHLSL.h b/src/compiler/translator/OutputHLSL.h
index 569b64b..ebc0033 100644
--- a/src/compiler/translator/OutputHLSL.h
+++ b/src/compiler/translator/OutputHLSL.h
@@ -30,11 +30,14 @@
 class OutputHLSL : public TIntermTraverser
 {
   public:
-    OutputHLSL(sh::GLenum shaderType, int shaderVersion,
-        const TExtensionBehavior &extensionBehavior,
-        const char *sourcePath, ShShaderOutput outputType,
-        int numRenderTargets, const std::vector<Uniform> &uniforms,
-        int compileOptions);
+    OutputHLSL(sh::GLenum shaderType,
+               int shaderVersion,
+               const TExtensionBehavior &extensionBehavior,
+               const char *sourcePath,
+               ShShaderOutput outputType,
+               int numRenderTargets,
+               const std::vector<Uniform> &uniforms,
+               ShCompileOptions compileOptions);
 
     ~OutputHLSL();
 
@@ -118,7 +121,7 @@
     const TExtensionBehavior &mExtensionBehavior;
     const char *mSourcePath;
     const ShShaderOutput mOutputType;
-    int mCompileOptions;
+    ShCompileOptions mCompileOptions;
 
     bool mInsideFunction;
 
diff --git a/src/compiler/translator/ParseContext.h b/src/compiler/translator/ParseContext.h
index 2b0320d..c2c4bf2 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -33,7 +33,7 @@
                   TExtensionBehavior &ext,
                   sh::GLenum type,
                   ShShaderSpec spec,
-                  int options,
+                  ShCompileOptions options,
                   bool checksPrecErrors,
                   TInfoSink &is,
                   const ShBuiltInResources &resources)
@@ -407,16 +407,18 @@
     bool mDeferredSingleDeclarationErrorCheck;
 
     sh::GLenum mShaderType;              // vertex or fragment language (future: pack or unpack)
-    ShShaderSpec mShaderSpec;              // The language specification compiler conforms to - GLES2 or WebGL.
-    int mCompileOptions;                   // Options passed to TCompiler
+    ShShaderSpec mShaderSpec;  // The language specification compiler conforms to - GLES2 or WebGL.
+    ShCompileOptions mCompileOptions;  // Options passed to TCompiler
     int mShaderVersion;
-    TIntermNode *mTreeRoot;       // root of parse tree being created
+    TIntermNode *mTreeRoot;      // root of parse tree being created
     int mLoopNestingLevel;       // 0 if outside all loops
-    int mStructNestingLevel;      // incremented while parsing a struct declaration
+    int mStructNestingLevel;     // incremented while parsing a struct declaration
     int mSwitchNestingLevel;     // 0 if outside all switch statements
-    const TType *mCurrentFunctionType;  // the return type of the function that's currently being parsed
+    const TType
+        *mCurrentFunctionType;   // the return type of the function that's currently being parsed
     bool mFunctionReturnsValue;  // true if a non-void function has a return
-    bool mChecksPrecisionErrors;  // true if an error will be generated when a variable is declared without precision, explicit or implicit.
+    bool mChecksPrecisionErrors;  // true if an error will be generated when a variable is declared
+                                  // without precision, explicit or implicit.
     bool mFragmentPrecisionHighOnESSL1;  // true if highp precision is supported when compiling
                                          // ESSL1.
     TLayoutMatrixPacking mDefaultMatrixPacking;
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 429bbf2..b6db0f0 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -268,11 +268,10 @@
 // Return:  The return value of ShCompile is really boolean, indicating
 // success or failure.
 //
-bool ShCompile(
-    const ShHandle handle,
-    const char *const shaderStrings[],
-    size_t numStrings,
-    int compileOptions)
+bool ShCompile(const ShHandle handle,
+               const char *const shaderStrings[],
+               size_t numStrings,
+               ShCompileOptions compileOptions)
 {
     TCompiler *compiler = GetCompilerFromHandle(handle);
     ASSERT(compiler);
diff --git a/src/compiler/translator/TranslatorESSL.cpp b/src/compiler/translator/TranslatorESSL.cpp
index d3a45310..109b170 100644
--- a/src/compiler/translator/TranslatorESSL.cpp
+++ b/src/compiler/translator/TranslatorESSL.cpp
@@ -16,7 +16,7 @@
 {
 }
 
-void TranslatorESSL::translate(TIntermNode *root, int compileOptions)
+void TranslatorESSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
 {
     TInfoSinkBase& sink = getInfoSink().obj;
 
diff --git a/src/compiler/translator/TranslatorESSL.h b/src/compiler/translator/TranslatorESSL.h
index a231476..f147ca0 100644
--- a/src/compiler/translator/TranslatorESSL.h
+++ b/src/compiler/translator/TranslatorESSL.h
@@ -15,7 +15,7 @@
     TranslatorESSL(sh::GLenum type, ShShaderSpec spec);
 
   protected:
-    void translate(TIntermNode *root, int compileOptions) override;
+    void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
     bool shouldFlattenPragmaStdglInvariantAll() override;
 
   private:
diff --git a/src/compiler/translator/TranslatorGLSL.cpp b/src/compiler/translator/TranslatorGLSL.cpp
index 1febbc7..7bd882b 100644
--- a/src/compiler/translator/TranslatorGLSL.cpp
+++ b/src/compiler/translator/TranslatorGLSL.cpp
@@ -20,7 +20,8 @@
     : TCompiler(type, spec, output) {
 }
 
-void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions)
+void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
+                                                 ShCompileOptions compileOptions)
 {
     if (compileOptions & SH_EMULATE_ABS_INT_FUNCTION)
     {
@@ -31,7 +32,7 @@
     InitBuiltInFunctionEmulatorForGLSLMissingFunctions(emu, getShaderType(), targetGLSLVersion);
 }
 
-void TranslatorGLSL::translate(TIntermNode *root, int compileOptions)
+void TranslatorGLSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
 {
     TInfoSinkBase& sink = getInfoSink().obj;
 
diff --git a/src/compiler/translator/TranslatorGLSL.h b/src/compiler/translator/TranslatorGLSL.h
index 91df588..f234c18 100644
--- a/src/compiler/translator/TranslatorGLSL.h
+++ b/src/compiler/translator/TranslatorGLSL.h
@@ -15,9 +15,10 @@
     TranslatorGLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
 
   protected:
-    void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) override;
+    void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
+                                     ShCompileOptions compileOptions) override;
 
-    void translate(TIntermNode *root, int compileOptions) override;
+    void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
     bool shouldFlattenPragmaStdglInvariantAll() override;
 
   private:
diff --git a/src/compiler/translator/TranslatorHLSL.cpp b/src/compiler/translator/TranslatorHLSL.cpp
index fb08bec..ab77049 100644
--- a/src/compiler/translator/TranslatorHLSL.cpp
+++ b/src/compiler/translator/TranslatorHLSL.cpp
@@ -28,7 +28,7 @@
 {
 }
 
-void TranslatorHLSL::translate(TIntermNode *root, int compileOptions)
+void TranslatorHLSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
 {
     const ShBuiltInResources &resources = getResources();
     int numRenderTargets = resources.EXT_draw_buffers ? resources.MaxDrawBuffers : 1;
diff --git a/src/compiler/translator/TranslatorHLSL.h b/src/compiler/translator/TranslatorHLSL.h
index f96c18d..213d860 100644
--- a/src/compiler/translator/TranslatorHLSL.h
+++ b/src/compiler/translator/TranslatorHLSL.h
@@ -21,11 +21,11 @@
     const std::map<std::string, unsigned int> *getUniformRegisterMap() const;
 
   protected:
-    void translate(TIntermNode *root, int compileOptions) override;
+    void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
     bool shouldFlattenPragmaStdglInvariantAll() override;
 
     // collectVariables needs to be run always so registers can be assigned.
-    bool shouldCollectVariables(int compileOptions) override { return true; }
+    bool shouldCollectVariables(ShCompileOptions compileOptions) override { return true; }
 
     std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
     std::map<std::string, unsigned int> mUniformRegisterMap;
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index 904345d..e008772 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -243,9 +243,9 @@
     std::stringstream sourceStream;
 
     std::string sourcePath;
-    int additionalOptions =
+    ShCompileOptions additionalOptions =
         mImplementation->prepareSourceAndReturnOptions(&sourceStream, &sourcePath);
-    int compileOptions    = (SH_OBJECT_CODE | SH_VARIABLES | additionalOptions);
+    ShCompileOptions compileOptions = (SH_OBJECT_CODE | SH_VARIABLES | additionalOptions);
 
     // Some targets (eg D3D11 Feature Level 9_3 and below) do not support non-constant loop indexes
     // in fragment shaders. Shader compilation will fail. To provide a better error message we can
diff --git a/src/libANGLE/renderer/ShaderImpl.h b/src/libANGLE/renderer/ShaderImpl.h
index 2ade19a..77f6e9b 100644
--- a/src/libANGLE/renderer/ShaderImpl.h
+++ b/src/libANGLE/renderer/ShaderImpl.h
@@ -22,8 +22,8 @@
     virtual ~ShaderImpl() { }
 
     // Returns additional ShCompile options.
-    virtual int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                              std::string *sourcePath) = 0;
+    virtual ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                           std::string *sourcePath) = 0;
     // Returns success for compiling on the driver. Returns success.
     virtual bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) = 0;
 
diff --git a/src/libANGLE/renderer/d3d/ShaderD3D.cpp b/src/libANGLE/renderer/d3d/ShaderD3D.cpp
index 326c198..b4e89b1 100644
--- a/src/libANGLE/renderer/d3d/ShaderD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ShaderD3D.cpp
@@ -133,12 +133,12 @@
     return mCompilerOutputType;
 }
 
-int ShaderD3D::prepareSourceAndReturnOptions(std::stringstream *shaderSourceStream,
-                                             std::string *sourcePath)
+ShCompileOptions ShaderD3D::prepareSourceAndReturnOptions(std::stringstream *shaderSourceStream,
+                                                          std::string *sourcePath)
 {
     uncompile();
 
-    int additionalOptions = 0;
+    ShCompileOptions additionalOptions = 0;
 
     const std::string &source = mData.getSource();
 
diff --git a/src/libANGLE/renderer/d3d/ShaderD3D.h b/src/libANGLE/renderer/d3d/ShaderD3D.h
index bf62158..587c121 100644
--- a/src/libANGLE/renderer/d3d/ShaderD3D.h
+++ b/src/libANGLE/renderer/d3d/ShaderD3D.h
@@ -28,8 +28,8 @@
     virtual ~ShaderD3D();
 
     // ShaderImpl implementation
-    int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                      std::string *sourcePath) override;
+    ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                   std::string *sourcePath) override;
     bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
     std::string getDebugInfo() const override;
 
@@ -77,7 +77,7 @@
     mutable std::string mDebugInfo;
     std::map<std::string, unsigned int> mUniformRegisterMap;
     std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
-    int mAdditionalOptions;
+    ShCompileOptions mAdditionalOptions;
 };
 }  // namespace rx
 
diff --git a/src/libANGLE/renderer/gl/ShaderGL.cpp b/src/libANGLE/renderer/gl/ShaderGL.cpp
index 400917b..8891aa7 100644
--- a/src/libANGLE/renderer/gl/ShaderGL.cpp
+++ b/src/libANGLE/renderer/gl/ShaderGL.cpp
@@ -36,8 +36,8 @@
     }
 }
 
-int ShaderGL::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                            std::string * /*sourcePath*/)
+ShCompileOptions ShaderGL::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                         std::string * /*sourcePath*/)
 {
     // Reset the previous state
     if (mShaderID != 0)
@@ -48,7 +48,7 @@
 
     *sourceStream << mData.getSource();
 
-    int options = SH_INIT_GL_POSITION;
+    ShCompileOptions options = SH_INIT_GL_POSITION;
 
     if (mWorkarounds.doWhileGLSLCausesGPUHang)
     {
diff --git a/src/libANGLE/renderer/gl/ShaderGL.h b/src/libANGLE/renderer/gl/ShaderGL.h
index f35d2f7..0ecd89c 100644
--- a/src/libANGLE/renderer/gl/ShaderGL.h
+++ b/src/libANGLE/renderer/gl/ShaderGL.h
@@ -25,8 +25,8 @@
     ~ShaderGL() override;
 
     // ShaderImpl implementation
-    int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                      std::string *sourcePath) override;
+    ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                   std::string *sourcePath) override;
     bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
     std::string getDebugInfo() const override;
 
diff --git a/src/libANGLE/renderer/vulkan/ShaderVk.cpp b/src/libANGLE/renderer/vulkan/ShaderVk.cpp
index 06355c3..8bece9b 100644
--- a/src/libANGLE/renderer/vulkan/ShaderVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ShaderVk.cpp
@@ -22,8 +22,8 @@
 {
 }
 
-int ShaderVk::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                            std::string *sourcePath)
+ShCompileOptions ShaderVk::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                         std::string *sourcePath)
 {
     UNIMPLEMENTED();
     return int();
diff --git a/src/libANGLE/renderer/vulkan/ShaderVk.h b/src/libANGLE/renderer/vulkan/ShaderVk.h
index f847070..1d713ca 100644
--- a/src/libANGLE/renderer/vulkan/ShaderVk.h
+++ b/src/libANGLE/renderer/vulkan/ShaderVk.h
@@ -22,8 +22,8 @@
     ~ShaderVk() override;
 
     // Returns additional ShCompile options.
-    int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
-                                      std::string *sourcePath) override;
+    ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
+                                                   std::string *sourcePath) override;
     // Returns success for compiling on the driver. Returns success.
     bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
 
diff --git a/src/tests/compiler_tests/ExpressionLimit_test.cpp b/src/tests/compiler_tests/ExpressionLimit_test.cpp
index 5d80f2a..f2a24a5 100644
--- a/src/tests/compiler_tests/ExpressionLimit_test.cpp
+++ b/src/tests/compiler_tests/ExpressionLimit_test.cpp
@@ -176,7 +176,7 @@
     // to the issue we are testing.
     bool CheckShaderCompilation(ShHandle compiler,
                                 const char *source,
-                                int compileOptions,
+                                ShCompileOptions compileOptions,
                                 const char *expected_error)
     {
         bool success = ShCompile(compiler, &source, 1, compileOptions) != 0;
@@ -213,7 +213,7 @@
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle vertexCompiler = ShConstructCompiler(
         GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
+    ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test expression under the limit passes.
     EXPECT_TRUE(CheckShaderCompilation(
@@ -242,7 +242,7 @@
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle vertexCompiler = ShConstructCompiler(
         GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
+    ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test expression under the limit passes.
     EXPECT_TRUE(CheckShaderCompilation(
@@ -271,7 +271,7 @@
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle vertexCompiler = ShConstructCompiler(
         GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
+    ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
 
     // Test call stack under the limit passes.
     EXPECT_TRUE(CheckShaderCompilation(
@@ -300,7 +300,7 @@
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle vertexCompiler = ShConstructCompiler(
         GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
+    ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
 
     // Test call stack under the limit passes.
     EXPECT_TRUE(CheckShaderCompilation(
@@ -329,7 +329,7 @@
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle vertexCompiler = ShConstructCompiler(
         GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions = 0;
+    ShCompileOptions compileOptions = 0;
 
     static const char* shaderWithRecursion0 = SHADER(
         precision mediump float;
@@ -544,7 +544,7 @@
     ShShaderSpec spec     = SH_WEBGL_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
     ShHandle compiler     = ShConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
-    int compileOptions    = SH_LIMIT_EXPRESSION_COMPLEXITY;
+    ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     // Test parameters under the limit succeeds.
     EXPECT_TRUE(CheckShaderCompilation(
diff --git a/src/tests/compiler_tests/MalformedShader_test.cpp b/src/tests/compiler_tests/MalformedShader_test.cpp
index 3bf1a8d..7032685 100644
--- a/src/tests/compiler_tests/MalformedShader_test.cpp
+++ b/src/tests/compiler_tests/MalformedShader_test.cpp
@@ -51,7 +51,7 @@
   protected:
     std::string mInfoLog;
     TranslatorESSL *mTranslator;
-    int mExtraCompileOptions;
+    ShCompileOptions mExtraCompileOptions;
 };
 
 class MalformedVertexShaderTest : public MalformedShaderTest
diff --git a/src/tests/test_utils/compiler_test.cpp b/src/tests/test_utils/compiler_test.cpp
index 7ffb602..5215d89 100644
--- a/src/tests/test_utils/compiler_test.cpp
+++ b/src/tests/test_utils/compiler_test.cpp
@@ -49,7 +49,7 @@
                        ShShaderOutput output,
                        const std::string &shaderString,
                        ShBuiltInResources *resources,
-                       int compileOptions,
+                       ShCompileOptions compileOptions,
                        std::string *translatedCode,
                        std::string *infoLog)
 {
@@ -76,7 +76,7 @@
                        ShShaderSpec spec,
                        ShShaderOutput output,
                        const std::string &shaderString,
-                       int compileOptions,
+                       ShCompileOptions compileOptions,
                        std::string *translatedCode,
                        std::string *infoLog)
 {
@@ -86,7 +86,7 @@
 }
 
 MatchOutputCodeTest::MatchOutputCodeTest(GLenum shaderType,
-                                         int defaultCompileOptions,
+                                         ShCompileOptions defaultCompileOptions,
                                          ShShaderOutput outputType)
     : mShaderType(shaderType), mDefaultCompileOptions(defaultCompileOptions)
 {
@@ -109,7 +109,8 @@
     compile(shaderString, mDefaultCompileOptions);
 }
 
-void MatchOutputCodeTest::compile(const std::string &shaderString, const int compileOptions)
+void MatchOutputCodeTest::compile(const std::string &shaderString,
+                                  const ShCompileOptions compileOptions)
 {
     std::string infoLog;
     for (auto &code : mOutputCode)
@@ -125,7 +126,7 @@
 
 bool MatchOutputCodeTest::compileWithSettings(ShShaderOutput output,
                                               const std::string &shaderString,
-                                              const int compileOptions,
+                                              const ShCompileOptions compileOptions,
                                               std::string *translatedCode,
                                               std::string *infoLog)
 {
diff --git a/src/tests/test_utils/compiler_test.h b/src/tests/test_utils/compiler_test.h
index 8ca82c0..01b606b 100644
--- a/src/tests/test_utils/compiler_test.h
+++ b/src/tests/test_utils/compiler_test.h
@@ -22,7 +22,7 @@
                        ShShaderOutput output,
                        const std::string &shaderString,
                        ShBuiltInResources *resources,
-                       int compileOptions,
+                       ShCompileOptions compileOptions,
                        std::string *translatedCode,
                        std::string *infoLog);
 
@@ -30,14 +30,16 @@
                        ShShaderSpec spec,
                        ShShaderOutput output,
                        const std::string &shaderString,
-                       int compileOptions,
+                       ShCompileOptions compileOptions,
                        std::string *translatedCode,
                        std::string *infoLog);
 
 class MatchOutputCodeTest : public testing::Test
 {
   protected:
-    MatchOutputCodeTest(GLenum shaderType, int defaultCompileOptions, ShShaderOutput outputType);
+    MatchOutputCodeTest(GLenum shaderType,
+                        ShCompileOptions defaultCompileOptions,
+                        ShShaderOutput outputType);
 
     void addOutputType(const ShShaderOutput outputType);
 
@@ -45,7 +47,7 @@
 
     // Compile functions clear any results from earlier calls to them.
     void compile(const std::string &shaderString);
-    void compile(const std::string &shaderString, const int compileOptions);
+    void compile(const std::string &shaderString, const ShCompileOptions compileOptions);
 
     bool foundInESSLCode(const char *stringToFind) const
     {
@@ -76,12 +78,12 @@
   private:
     bool compileWithSettings(ShShaderOutput output,
                              const std::string &shaderString,
-                             int compileOptions,
+                             ShCompileOptions compileOptions,
                              std::string *translatedCode,
                              std::string *infoLog);
 
     GLenum mShaderType;
-    int mDefaultCompileOptions;
+    ShCompileOptions mDefaultCompileOptions;
     ShBuiltInResources mResources;
 
     std::map<ShShaderOutput, std::string> mOutputCode;