summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/SymbolTable.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/src/compiler/translator/SymbolTable.h')
-rwxr-xr-xgfx/angle/src/compiler/translator/SymbolTable.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/gfx/angle/src/compiler/translator/SymbolTable.h b/gfx/angle/src/compiler/translator/SymbolTable.h
index 7c4d3aab3..60e0b9929 100755
--- a/gfx/angle/src/compiler/translator/SymbolTable.h
+++ b/gfx/angle/src/compiler/translator/SymbolTable.h
@@ -38,16 +38,16 @@
#include "compiler/translator/InfoSink.h"
#include "compiler/translator/IntermNode.h"
-namespace sh
-{
-
// Symbol base class. (Can build functions or variables out of these...)
class TSymbol : angle::NonCopyable
{
public:
POOL_ALLOCATOR_NEW_DELETE();
- TSymbol(const TString *n);
-
+ TSymbol(const TString *n)
+ : uniqueId(0),
+ name(n)
+ {
+ }
virtual ~TSymbol()
{
// don't delete name, it's from the pool
@@ -69,6 +69,10 @@ class TSymbol : angle::NonCopyable
{
return false;
}
+ void setUniqueId(int id)
+ {
+ uniqueId = id;
+ }
int getUniqueId() const
{
return uniqueId;
@@ -83,7 +87,7 @@ class TSymbol : angle::NonCopyable
}
private:
- const int uniqueId;
+ int uniqueId; // For real comparing during code generation
const TString *name;
TString extension;
};
@@ -225,8 +229,6 @@ class TFunction : public TSymbol
mangledName = nullptr;
}
- void swapParameters(const TFunction &parametersSource);
-
const TString &getMangledName() const override
{
if (mangledName == nullptr)
@@ -260,8 +262,6 @@ class TFunction : public TSymbol
}
private:
- void clearParameters();
-
const TString *buildMangledName() const;
typedef TVector<TConstParameter> TParamList;
@@ -459,11 +459,8 @@ class TSymbolTable : angle::NonCopyable
TSymbol *find(const TString &name, int shaderVersion,
bool *builtIn = NULL, bool *sameScope = NULL) const;
-
- TSymbol *findGlobal(const TString &name) const;
-
TSymbol *findBuiltIn(const TString &name, int shaderVersion) const;
-
+
TSymbolTableLevel *getOuterLevel()
{
assert(currentLevel() >= 1);
@@ -474,15 +471,15 @@ class TSymbolTable : angle::NonCopyable
bool setDefaultPrecision(const TPublicType &type, TPrecision prec)
{
- if (!SupportsPrecision(type.getBasicType()))
+ if (!SupportsPrecision(type.type))
return false;
- if (type.getBasicType() == EbtUInt)
+ if (type.type == EbtUInt)
return false; // ESSL 3.00.4 section 4.5.4
if (type.isAggregate())
return false; // Not allowed to set for aggregate types
int indexOfLastElement = static_cast<int>(precisionStack.size()) - 1;
// Uses map operator [], overwrites the current value
- (*precisionStack[indexOfLastElement])[type.getBasicType()] = prec;
+ (*precisionStack[indexOfLastElement])[type.type] = prec;
return true;
}
@@ -544,6 +541,4 @@ class TSymbolTable : angle::NonCopyable
static int uniqueIdCounter;
};
-} // namespace sh
-
#endif // COMPILER_TRANSLATOR_SYMBOLTABLE_H_