Commit d7ceaa16 by Olli Etuaho Committed by Commit Bot

Remove TIntermSymbol::setId

The only place it was being used was when parsing array declarators. The declarator only needs to be added to the AST when the variable has successfully been declared, so this usage was not necessary. BUG=angleproject:1490 TEST=angle_unittests Change-Id: I05b8851cfdebc9253c9fda8b12733f23da604ca6 Reviewed-on: https://chromium-review.googlesource.com/569160Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent d178aa46
...@@ -270,8 +270,6 @@ class TIntermSymbol : public TIntermTyped ...@@ -270,8 +270,6 @@ class TIntermSymbol : public TIntermTyped
const TName &getName() const { return mSymbol; } const TName &getName() const { return mSymbol; }
TName &getName() { return mSymbol; } TName &getName() { return mSymbol; }
void setId(int newId) { mId = newId; }
void setInternal(bool internal) { mSymbol.setInternal(internal); } void setInternal(bool internal) { mSymbol.setInternal(internal); }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
...@@ -279,7 +277,7 @@ class TIntermSymbol : public TIntermTyped ...@@ -279,7 +277,7 @@ class TIntermSymbol : public TIntermTyped
bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; } bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
protected: protected:
int mId; const int mId;
TName mSymbol; TName mSymbol;
private: private:
......
...@@ -2480,12 +2480,13 @@ void TParseContext::parseArrayDeclarator(TPublicType &publicType, ...@@ -2480,12 +2480,13 @@ void TParseContext::parseArrayDeclarator(TPublicType &publicType,
TVariable *variable = nullptr; TVariable *variable = nullptr;
declareVariable(identifierLocation, identifier, arrayType, &variable); declareVariable(identifierLocation, identifier, arrayType, &variable);
TIntermSymbol *symbol = new TIntermSymbol(0, identifier, arrayType);
symbol->setLine(identifierLocation);
if (variable) if (variable)
symbol->setId(variable->getUniqueId()); {
TIntermSymbol *symbol =
declarationOut->appendDeclarator(symbol); new TIntermSymbol(variable->getUniqueId(), identifier, arrayType);
symbol->setLine(identifierLocation);
declarationOut->appendDeclarator(symbol);
}
} }
} }
......
...@@ -107,8 +107,6 @@ class TStructure : public TFieldListCollection ...@@ -107,8 +107,6 @@ class TStructure : public TFieldListCollection
bool equals(const TStructure &other) const; bool equals(const TStructure &other) const;
void setUniqueId(int uniqueId) { mUniqueId = uniqueId; }
int uniqueId() const int uniqueId() const
{ {
ASSERT(mUniqueId != 0); ASSERT(mUniqueId != 0);
......
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