blob: 75f8332d88a52c5a7bc6d44c91e14333ce6459ae [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
Nicolas Capens1fbc2872014-01-03 14:12:09 -05002// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
Geoff Lang0a73dd82014-11-19 16:18:08 -05007#ifndef COMPILER_TRANSLATOR_SYMBOLTABLE_H_
8#define COMPILER_TRANSLATOR_SYMBOLTABLE_H_
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00009
10//
11// Symbol table for parsing. Has these design characteristics:
12//
13// * Same symbol table can be used to compile many shaders, to preserve
14// effort of creating and loading with the large numbers of built-in
15// symbols.
16//
17// * Name mangling will be used to give each function a unique name
18// so that symbol table lookups are never ambiguous. This allows
19// a simpler symbol table structure.
20//
Jamie Madilld7b1ab52016-12-12 14:42:19 -050021// * Pushing and popping of scope, so symbol table will really be a stack
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022// of symbol tables. Searched from the top, with new inserts going into
23// the top.
24//
25// * Constants: Compile time constant symbols will keep their values
26// in the symbol table. The parser can substitute constants at parse
27// time, including doing constant folding and constant propagation.
28//
29// * No temporaries: Temporaries made from operations (+, --, .xy, etc.)
30// are tracked in the intermediate representation, not the symbol table.
31//
32
Martin Radeve93d24e2016-07-28 12:06:05 +030033#include <array>
alokp@chromium.org4e4facd2010-06-02 15:21:22 +000034#include <assert.h>
Zhenyao Mo94ac7b72014-10-15 18:22:08 -070035#include <set>
alokp@chromium.orge4249f02010-07-26 18:13:52 +000036
Jamie Madill703cdd62013-07-08 15:07:30 -040037#include "common/angleutils.h"
Olli Etuaho2a1e8f92017-07-14 11:49:36 +030038#include "compiler/translator/ExtensionBehavior.h"
Geoff Lang17732822013-08-29 13:46:49 -040039#include "compiler/translator/InfoSink.h"
Jamie Madillb1a85f42014-08-19 15:23:24 -040040#include "compiler/translator/IntermNode.h"
Olli Etuahod4529f32017-12-12 13:06:40 +020041#include "compiler/translator/Symbol.h"
alokp@chromium.org43884872010-03-30 00:08:52 +000042
Jamie Madill45bcc782016-11-07 13:58:48 -050043namespace sh
44{
45
Zhenyao Mo9eedea02014-05-12 16:02:35 -070046class TSymbolTableLevel
47{
48 public:
Kai Ninomiyad4556df2017-09-27 16:45:22 -070049 typedef TUnorderedMap<TString, TSymbol *> tLevel;
alokp@chromium.org43884872010-03-30 00:08:52 +000050 typedef tLevel::const_iterator const_iterator;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000051 typedef const tLevel::value_type tLevelPair;
52 typedef std::pair<tLevel::iterator, bool> tInsertResult;
53
Jamie Madilld7b1ab52016-12-12 14:42:19 -050054 TSymbolTableLevel() : mGlobalInvariant(false) {}
alokp@chromium.org43884872010-03-30 00:08:52 +000055 ~TSymbolTableLevel();
56
Nicolas Capensadfffe42014-06-17 02:13:36 -040057 bool insert(TSymbol *symbol);
Nicolas Capensbd10cf52013-06-20 09:51:51 -040058
Olli Etuahob2983c92015-03-18 14:02:46 +020059 // Insert a function using its unmangled name as the key.
60 bool insertUnmangled(TFunction *function);
61
Jamie Madillbfa91f42014-06-05 15:45:18 -040062 TSymbol *find(const TString &name) const;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000063
Jamie Madilld7b1ab52016-12-12 14:42:19 -050064 void addInvariantVarying(const std::string &name) { mInvariantVaryings.insert(name); }
Qiankun Miaof69682b2016-08-16 14:50:42 +080065
66 bool isVaryingInvariant(const std::string &name)
67 {
68 return (mGlobalInvariant || mInvariantVaryings.count(name) > 0);
69 }
70
71 void setGlobalInvariant(bool invariant) { mGlobalInvariant = invariant; }
72
Martin Radevda6254b2016-12-14 17:00:36 +020073 void insertUnmangledBuiltInName(const std::string &name)
74 {
75 mUnmangledBuiltInNames.insert(name);
76 }
77
78 bool hasUnmangledBuiltIn(const std::string &name)
79 {
80 return mUnmangledBuiltInNames.count(name) > 0;
81 }
82
Zhenyao Mo9eedea02014-05-12 16:02:35 -070083 protected:
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000084 tLevel level;
Qiankun Miaof69682b2016-08-16 14:50:42 +080085 std::set<std::string> mInvariantVaryings;
86 bool mGlobalInvariant;
Martin Radevda6254b2016-12-14 17:00:36 +020087
88 private:
89 std::set<std::string> mUnmangledBuiltInNames;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000090};
91
Gus Fernandez964df492014-10-13 11:54:39 -070092// Define ESymbolLevel as int rather than an enum since level can go
93// above GLOBAL_LEVEL and cause atBuiltInLevel() to fail if the
94// compiler optimizes the >= of the last element to ==.
95typedef int ESymbolLevel;
Jamie Madilld7b1ab52016-12-12 14:42:19 -050096const int COMMON_BUILTINS = 0;
97const int ESSL1_BUILTINS = 1;
98const int ESSL3_BUILTINS = 2;
Martin Radeve93d24e2016-07-28 12:06:05 +030099const int ESSL3_1_BUILTINS = 3;
Olli Etuaho977ee7e2017-07-21 11:38:27 +0300100// GLSL_BUILTINS are desktop GLSL builtins that don't exist in ESSL but are used to implement
101// features in ANGLE's GLSL backend. They're not visible to the parser.
102const int GLSL_BUILTINS = 4;
103const int LAST_BUILTIN_LEVEL = GLSL_BUILTINS;
104const int GLOBAL_LEVEL = 5;
shannonwoods@chromium.org6e10a0e2013-05-30 00:02:13 +0000105
Jamie Madillf0d10f82015-03-31 12:56:52 -0400106class TSymbolTable : angle::NonCopyable
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700107{
108 public:
Olli Etuaho195be942017-12-04 23:40:14 +0200109 TSymbolTable() : mUniqueIdCounter(0), mUserDefinedUniqueIdsStart(-1)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000110 {
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000111 // The symbol table cannot be used until push() is called, but
112 // the lack of an initial call to push() can be used to detect
113 // that the symbol table has not been preloaded with built-ins.
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000114 }
115
Alok Priyadarshibc3f1ac2013-09-23 14:57:02 -0400116 ~TSymbolTable();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000117
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000118 // When the symbol table is initialized with the built-ins, there should
119 // 'push' calls, so that built-ins are at level 0 and the shader
120 // globals are at level 1.
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500121 bool isEmpty() const { return table.empty(); }
122 bool atBuiltInLevel() const { return currentLevel() <= LAST_BUILTIN_LEVEL; }
123 bool atGlobalLevel() const { return currentLevel() == GLOBAL_LEVEL; }
alokp@chromium.org43884872010-03-30 00:08:52 +0000124 void push()
alokp@chromium.orge4249f02010-07-26 18:13:52 +0000125 {
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000126 table.push_back(new TSymbolTableLevel);
Alok Priyadarshibc3f1ac2013-09-23 14:57:02 -0400127 precisionStack.push_back(new PrecisionStackLevel);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000128 }
129
alokp@chromium.org43884872010-03-30 00:08:52 +0000130 void pop()
Alok Priyadarshibc3f1ac2013-09-23 14:57:02 -0400131 {
132 delete table.back();
133 table.pop_back();
134
135 delete precisionStack.back();
daniel@transgaming.coma5d76232010-05-17 09:58:47 +0000136 precisionStack.pop_back();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000137 }
138
Olli Etuaho0f684632017-07-13 12:42:15 +0300139 // The declare* entry points are used when parsing and declare symbols at the current scope.
Olli Etuaho035419f2017-11-28 14:27:15 +0200140 // They return the created symbol / true in case the declaration was successful, and nullptr /
141 // false if the declaration failed due to redefinition.
Olli Etuaho195be942017-12-04 23:40:14 +0200142 bool declareVariable(TVariable *variable);
Olli Etuaho035419f2017-11-28 14:27:15 +0200143 bool declareStructType(TStructure *str);
Olli Etuaho378c3a52017-12-04 11:32:13 +0200144 bool declareInterfaceBlock(TInterfaceBlock *interfaceBlock);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +0000145
Olli Etuaho0f684632017-07-13 12:42:15 +0300146 // The insert* entry points are used when initializing the symbol table with built-ins.
Olli Etuaho035419f2017-11-28 14:27:15 +0200147 // They return the created symbol / true in case the declaration was successful, and nullptr /
148 // false if the declaration failed due to redefinition.
Olli Etuaho0f684632017-07-13 12:42:15 +0300149 TVariable *insertVariable(ESymbolLevel level, const char *name, const TType &type);
150 TVariable *insertVariableExt(ESymbolLevel level,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300151 TExtension ext,
Olli Etuaho0f684632017-07-13 12:42:15 +0300152 const char *name,
153 const TType &type);
Olli Etuaho195be942017-12-04 23:40:14 +0200154 bool insertVariable(ESymbolLevel level, TVariable *variable);
Olli Etuaho035419f2017-11-28 14:27:15 +0200155 bool insertStructType(ESymbolLevel level, TStructure *str);
Olli Etuaho378c3a52017-12-04 11:32:13 +0200156 bool insertInterfaceBlock(ESymbolLevel level, TInterfaceBlock *interfaceBlock);
Nicolas Capensc9d9b302015-02-20 23:02:15 -0500157
Martin Radeve93d24e2016-07-28 12:06:05 +0300158 bool insertConstInt(ESymbolLevel level, const char *name, int value, TPrecision precision)
Nicolas Capens49a88872013-06-20 09:54:03 -0400159 {
Olli Etuaho9d4d7f02017-12-07 17:11:41 +0100160 TVariable *constant = new TVariable(
161 this, NewPoolTString(name), TType(EbtInt, precision, EvqConst, 1), SymbolType::BuiltIn);
Olli Etuaho5c0e0232015-11-11 15:55:59 +0200162 TConstantUnion *unionArray = new TConstantUnion[1];
163 unionArray[0].setIConst(value);
164 constant->shareConstPointer(unionArray);
Nicolas Capensadfffe42014-06-17 02:13:36 -0400165 return insert(level, constant);
Nicolas Capens49a88872013-06-20 09:54:03 -0400166 }
167
Jiawei Shaod27f5c82017-08-23 09:38:08 +0800168 bool insertConstIntExt(ESymbolLevel level,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300169 TExtension ext,
Jiawei Shaod27f5c82017-08-23 09:38:08 +0800170 const char *name,
171 int value,
172 TPrecision precision)
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +0300173 {
174 TVariable *constant =
Olli Etuaho9d4d7f02017-12-07 17:11:41 +0100175 new TVariable(this, NewPoolTString(name), TType(EbtInt, precision, EvqConst, 1),
176 SymbolType::BuiltIn, ext);
Olli Etuaho5c0e0232015-11-11 15:55:59 +0200177 TConstantUnion *unionArray = new TConstantUnion[1];
178 unionArray[0].setIConst(value);
179 constant->shareConstPointer(unionArray);
Olli Etuaho5d69db12017-11-24 16:51:15 +0200180 return insert(level, constant);
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +0300181 }
182
Martin Radeve93d24e2016-07-28 12:06:05 +0300183 bool insertConstIvec3(ESymbolLevel level,
184 const char *name,
185 const std::array<int, 3> &values,
186 TPrecision precision)
187 {
Olli Etuaho9d4d7f02017-12-07 17:11:41 +0100188 TVariable *constantIvec3 = new TVariable(
189 this, NewPoolTString(name), TType(EbtInt, precision, EvqConst, 3), SymbolType::BuiltIn);
Martin Radeve93d24e2016-07-28 12:06:05 +0300190
191 TConstantUnion *unionArray = new TConstantUnion[3];
192 for (size_t index = 0u; index < 3u; ++index)
193 {
194 unionArray[index].setIConst(values[index]);
195 }
196 constantIvec3->shareConstPointer(unionArray);
197
198 return insert(level, constantIvec3);
199 }
200
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500201 void insertBuiltIn(ESymbolLevel level,
202 TOperator op,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300203 TExtension ext,
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500204 const TType *rvalue,
205 const char *name,
206 const TType *ptype1,
207 const TType *ptype2 = 0,
208 const TType *ptype3 = 0,
209 const TType *ptype4 = 0,
210 const TType *ptype5 = 0);
Nicolas Capens759b9942014-02-14 17:57:14 -0500211
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500212 void insertBuiltIn(ESymbolLevel level,
213 const TType *rvalue,
214 const char *name,
215 const TType *ptype1,
216 const TType *ptype2 = 0,
217 const TType *ptype3 = 0,
218 const TType *ptype4 = 0,
219 const TType *ptype5 = 0)
Nicolas Capens482907e2015-02-23 16:56:33 -0500220 {
Martin Radevda6254b2016-12-14 17:00:36 +0200221 insertUnmangledBuiltInName(name, level);
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300222 insertBuiltIn(level, EOpNull, TExtension::UNDEFINED, rvalue, name, ptype1, ptype2, ptype3,
223 ptype4, ptype5);
Nicolas Capensc9d9b302015-02-20 23:02:15 -0500224 }
225
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500226 void insertBuiltIn(ESymbolLevel level,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300227 TExtension ext,
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500228 const TType *rvalue,
229 const char *name,
230 const TType *ptype1,
231 const TType *ptype2 = 0,
232 const TType *ptype3 = 0,
233 const TType *ptype4 = 0,
234 const TType *ptype5 = 0)
Nicolas Capensc9d9b302015-02-20 23:02:15 -0500235 {
Martin Radevda6254b2016-12-14 17:00:36 +0200236 insertUnmangledBuiltInName(name, level);
Nicolas Capensc9d9b302015-02-20 23:02:15 -0500237 insertBuiltIn(level, EOpNull, ext, rvalue, name, ptype1, ptype2, ptype3, ptype4, ptype5);
238 }
239
Olli Etuaho492cfab2017-01-20 21:18:29 +0000240 void insertBuiltInOp(ESymbolLevel level,
241 TOperator op,
242 const TType *rvalue,
243 const TType *ptype1,
244 const TType *ptype2 = 0,
245 const TType *ptype3 = 0,
246 const TType *ptype4 = 0,
247 const TType *ptype5 = 0);
248
249 void insertBuiltInOp(ESymbolLevel level,
250 TOperator op,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300251 TExtension ext,
Olli Etuaho492cfab2017-01-20 21:18:29 +0000252 const TType *rvalue,
253 const TType *ptype1,
254 const TType *ptype2 = 0,
255 const TType *ptype3 = 0,
256 const TType *ptype4 = 0,
257 const TType *ptype5 = 0);
Nicolas Capens482907e2015-02-23 16:56:33 -0500258
Martin Radevd7c5b0a2016-07-27 14:04:43 +0300259 void insertBuiltInFunctionNoParameters(ESymbolLevel level,
260 TOperator op,
261 const TType *rvalue,
262 const char *name);
263
Jiawei Shaod27f5c82017-08-23 09:38:08 +0800264 void insertBuiltInFunctionNoParametersExt(ESymbolLevel level,
Olli Etuaho2a1e8f92017-07-14 11:49:36 +0300265 TExtension ext,
Jiawei Shaod27f5c82017-08-23 09:38:08 +0800266 TOperator op,
267 const TType *rvalue,
268 const char *name);
269
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500270 TSymbol *find(const TString &name,
271 int shaderVersion,
Yunchao He4f285442017-04-21 12:15:49 +0800272 bool *builtIn = nullptr,
273 bool *sameScope = nullptr) const;
Zhenyao Mod7490962016-11-09 15:49:51 -0800274
275 TSymbol *findGlobal(const TString &name) const;
276
Zhenyao Moe740add2014-07-18 17:01:01 -0700277 TSymbol *findBuiltIn(const TString &name, int shaderVersion) const;
Zhenyao Mod7490962016-11-09 15:49:51 -0800278
Olli Etuaho977ee7e2017-07-21 11:38:27 +0300279 TSymbol *findBuiltIn(const TString &name, int shaderVersion, bool includeGLSLBuiltins) const;
280
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700281 TSymbolTableLevel *getOuterLevel()
282 {
shannonwoods@chromium.org6e10a0e2013-05-30 00:02:13 +0000283 assert(currentLevel() >= 1);
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +0000284 return table[currentLevel() - 1];
285 }
286
Olli Etuahocce89652017-06-19 16:04:09 +0300287 void setDefaultPrecision(TBasicType type, TPrecision prec)
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700288 {
daniel@transgaming.coma5d76232010-05-17 09:58:47 +0000289 int indexOfLastElement = static_cast<int>(precisionStack.size()) - 1;
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700290 // Uses map operator [], overwrites the current value
Olli Etuahocce89652017-06-19 16:04:09 +0300291 (*precisionStack[indexOfLastElement])[type] = prec;
daniel@transgaming.coma5d76232010-05-17 09:58:47 +0000292 }
293
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700294 // Searches down the precisionStack for a precision qualifier
295 // for the specified TBasicType
Zhenyao Moe740add2014-07-18 17:01:01 -0700296 TPrecision getDefaultPrecision(TBasicType type) const;
shannonwoods@chromium.org6b709912013-05-30 00:20:04 +0000297
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700298 // This records invariant varyings declared through
299 // "invariant varying_name;".
Jamie Madill2c433252014-12-03 12:36:54 -0500300 void addInvariantVarying(const std::string &originalName)
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700301 {
Qiankun Miaof69682b2016-08-16 14:50:42 +0800302 ASSERT(atGlobalLevel());
303 table[currentLevel()]->addInvariantVarying(originalName);
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700304 }
305 // If this returns false, the varying could still be invariant
306 // if it is set as invariant during the varying variable
307 // declaration - this piece of information is stored in the
308 // variable's type, not here.
Jamie Madill2c433252014-12-03 12:36:54 -0500309 bool isVaryingInvariant(const std::string &originalName) const
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700310 {
Qiankun Miaof69682b2016-08-16 14:50:42 +0800311 ASSERT(atGlobalLevel());
312 return table[currentLevel()]->isVaryingInvariant(originalName);
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700313 }
314
Qiankun Miaof69682b2016-08-16 14:50:42 +0800315 void setGlobalInvariant(bool invariant)
316 {
317 ASSERT(atGlobalLevel());
318 table[currentLevel()]->setGlobalInvariant(invariant);
319 }
Zhenyao Mo94ac7b72014-10-15 18:22:08 -0700320
Olli Etuaho2d88e9b2017-07-21 16:52:03 +0300321 const TSymbolUniqueId nextUniqueId() { return TSymbolUniqueId(this); }
322
Martin Radevda6254b2016-12-14 17:00:36 +0200323 // Checks whether there is a built-in accessible by a shader with the specified version.
324 bool hasUnmangledBuiltInForShaderVersion(const char *name, int shaderVersion);
Olli Etuahoc4a96d62015-07-23 17:37:39 +0530325
Olli Etuaho5d69db12017-11-24 16:51:15 +0200326 void markBuiltInInitializationFinished();
327 void clearCompilationResults();
328
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700329 private:
Olli Etuaho2d88e9b2017-07-21 16:52:03 +0300330 friend class TSymbolUniqueId;
Olli Etuaho5d69db12017-11-24 16:51:15 +0200331 int nextUniqueIdValue();
Olli Etuaho2d88e9b2017-07-21 16:52:03 +0300332
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500333 ESymbolLevel currentLevel() const { return static_cast<ESymbolLevel>(table.size() - 1); }
daniel@transgaming.coma5d76232010-05-17 09:58:47 +0000334
Olli Etuaho9d4d7f02017-12-07 17:11:41 +0100335 TVariable *insertVariable(ESymbolLevel level,
336 const TString *name,
337 const TType &type,
338 SymbolType symbolType);
Olli Etuaho0f684632017-07-13 12:42:15 +0300339
Olli Etuaho5d69db12017-11-24 16:51:15 +0200340 bool insert(ESymbolLevel level, TSymbol *symbol)
Olli Etuaho0f684632017-07-13 12:42:15 +0300341 {
Olli Etuaho5d69db12017-11-24 16:51:15 +0200342 ASSERT(level > LAST_BUILTIN_LEVEL || mUserDefinedUniqueIdsStart == -1);
Olli Etuaho0f684632017-07-13 12:42:15 +0300343 return table[level]->insert(symbol);
344 }
345
Martin Radevda6254b2016-12-14 17:00:36 +0200346 // Used to insert unmangled functions to check redeclaration of built-ins in ESSL 3.00 and
347 // above.
348 void insertUnmangledBuiltInName(const char *name, ESymbolLevel level);
349
350 bool hasUnmangledBuiltInAtLevel(const char *name, ESymbolLevel level);
Olli Etuahoc4a96d62015-07-23 17:37:39 +0530351
Zhenyao Mo9eedea02014-05-12 16:02:35 -0700352 std::vector<TSymbolTableLevel *> table;
Alok Priyadarshibc3f1ac2013-09-23 14:57:02 -0400353 typedef TMap<TBasicType, TPrecision> PrecisionStackLevel;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500354 std::vector<PrecisionStackLevel *> precisionStack;
Jamie Madillbfa91f42014-06-05 15:45:18 -0400355
Olli Etuahoa5e693a2017-07-13 16:07:26 +0300356 int mUniqueIdCounter;
Olli Etuaho2d88e9b2017-07-21 16:52:03 +0300357
Olli Etuaho5d69db12017-11-24 16:51:15 +0200358 // -1 before built-in init has finished, one past the last built-in id afterwards.
359 // TODO(oetuaho): Make this a compile-time constant once the symbol table is initialized at
360 // compile time. http://anglebug.com/1432
361 int mUserDefinedUniqueIdsStart;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000362};
363
Jamie Madill45bcc782016-11-07 13:58:48 -0500364} // namespace sh
365
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500366#endif // COMPILER_TRANSLATOR_SYMBOLTABLE_H_