Make unique id counter a member of TSymbolTable
This makes unique id counting thread-safe.
BUG=angleproject:624
TEST=angle_unittests
Change-Id: Ie0f2c7e574470b39750d37d2181c790bc874b275
Reviewed-on: https://chromium-review.googlesource.com/570419
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index 87abe98..ae445fd 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -3080,13 +3080,13 @@
}
// Add the function as a prototype after parsing it (we do not support recursion)
- return new TFunction(name, new TType(type));
+ return new TFunction(&symbolTable, name, new TType(type));
}
TFunction *TParseContext::addNonConstructorFunc(const TString *name, const TSourceLoc &loc)
{
const TType *returnType = TCache::getType(EbtVoid, EbpUndefined);
- return new TFunction(name, returnType);
+ return new TFunction(&symbolTable, name, returnType);
}
TFunction *TParseContext::addConstructorFunc(const TPublicType &publicType)
@@ -3110,7 +3110,7 @@
type->setBasicType(EbtFloat);
}
- return new TFunction(nullptr, type, EOpConstruct);
+ return new TFunction(&symbolTable, nullptr, type, EOpConstruct);
}
TParameter TParseContext::parseParameterDeclarator(const TPublicType &publicType,
@@ -4143,7 +4143,7 @@
const TString *structName,
TFieldList *fieldList)
{
- TStructure *structure = new TStructure(structName, fieldList);
+ TStructure *structure = new TStructure(&symbolTable, structName, fieldList);
// Store a bool in the struct if we're at global scope, to allow us to
// skip the local struct scoping workaround in HLSL.