Commit ca092f01 by George Burgess IV Committed by Commit Bot

translator: explicitly specify underlying types for enums

Some of these enums are stored in const structs and such. Since we don't need a full `sizeof(int)` bytes each, don't use it. This shaves 16KB off of libGLESv2.so for eve. Bug: chromium:1084580 Change-Id: Ib6eca49203a74c094661f890e32160974c0c531e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2216431 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 4a81e3db
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
#ifndef COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_ #ifndef COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
#define COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_ #define COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
#include <cstdint>
#include <map> #include <map>
namespace sh namespace sh
{ {
enum class TExtension enum class TExtension : uint8_t
{ {
UNDEFINED, // Special value used to indicate no extension. UNDEFINED, // Special value used to indicate no extension.
...@@ -46,7 +47,7 @@ enum class TExtension ...@@ -46,7 +47,7 @@ enum class TExtension
APPLE_clip_distance, APPLE_clip_distance,
}; };
enum TBehavior enum TBehavior : uint8_t
{ {
EBhRequire, EBhRequire,
EBhEnable, EBhEnable,
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
#ifndef COMPILER_TRANSLATOR_OPERATOR_H_ #ifndef COMPILER_TRANSLATOR_OPERATOR_H_
#define COMPILER_TRANSLATOR_OPERATOR_H_ #define COMPILER_TRANSLATOR_OPERATOR_H_
#include <cstdint>
// //
// Operators used by the high-level (parse tree) representation. // Operators used by the high-level (parse tree) representation.
// //
enum TOperator enum TOperator : uint8_t
{ {
EOpNull, // if in a node, should only mean a node is still being built EOpNull, // if in a node, should only mean a node is still being built
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "compiler/translator/Symbol.h" #include "compiler/translator/Symbol.h"
#include "compiler/translator/SymbolTable_autogen.h" #include "compiler/translator/SymbolTable_autogen.h"
enum class Shader enum class Shader : uint8_t
{ {
ALL, ALL,
FRAGMENT, // GL_FRAGMENT_SHADER FRAGMENT, // GL_FRAGMENT_SHADER
...@@ -66,7 +66,7 @@ struct UnmangledBuiltIn ...@@ -66,7 +66,7 @@ struct UnmangledBuiltIn
using VarPointer = TSymbol *(TSymbolTableBase::*); using VarPointer = TSymbol *(TSymbolTableBase::*);
using ValidateExtension = int ShBuiltInResources::*; using ValidateExtension = int ShBuiltInResources::*;
enum class Spec enum class Spec : uint8_t
{ {
GLSL, GLSL,
ESSL ESSL
......
...@@ -37,7 +37,7 @@ class TSymbolUniqueId ...@@ -37,7 +37,7 @@ class TSymbolUniqueId
int mId; int mId;
}; };
enum class SymbolType enum class SymbolType : uint8_t
{ {
BuiltIn, BuiltIn,
UserDefined, UserDefined,
...@@ -45,7 +45,7 @@ enum class SymbolType ...@@ -45,7 +45,7 @@ enum class SymbolType
Empty // Meaning symbol without a name. Empty // Meaning symbol without a name.
}; };
enum class SymbolClass enum class SymbolClass : uint8_t
{ {
Function, Function,
Variable, Variable,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment