Hash :
f5557acc
Author :
Date :
2018-06-15T09:46:58
translator: Store symbol type in TField. This allows us to keep a separate symbol type for each field in a struct. This can allow us to assign internal names to struct types. It could also allow us to add internal fields to user defined stucts. Bug: angleproject:2665 Change-Id: I6a129107d9db66c54b98b07684c3ead5801712ba Reviewed-on: https://chromium-review.googlesource.com/1101565 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
//
// Copyright (c) 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// SymbolUniqueId.h: Encapsulates a unique id for a symbol.
#ifndef COMPILER_TRANSLATOR_SYMBOLUNIQUEID_H_
#define COMPILER_TRANSLATOR_SYMBOLUNIQUEID_H_
#include "compiler/translator/Common.h"
namespace sh
{
class TSymbolTable;
class TSymbol;
class TSymbolUniqueId
{
public:
POOL_ALLOCATOR_NEW_DELETE();
explicit TSymbolUniqueId(const TSymbol &symbol);
constexpr TSymbolUniqueId(const TSymbolUniqueId &) = default;
TSymbolUniqueId &operator =(const TSymbolUniqueId &);
bool operator==(const TSymbolUniqueId &) const;
constexpr int get() const { return mId; }
private:
friend class TSymbolTable;
explicit TSymbolUniqueId(TSymbolTable *symbolTable);
friend class BuiltInId;
constexpr TSymbolUniqueId(int staticId) : mId(staticId) {}
int mId;
};
enum class SymbolType
{
BuiltIn,
UserDefined,
AngleInternal,
Empty // Meaning symbol without a name.
};
enum class SymbolClass
{
Function,
Variable,
Struct,
InterfaceBlock
};
} // namespace sh
#endif // COMPILER_TRANSLATOR_SYMBOLUNIQUEID_H_