Replace remaining usage of TName with TSymbol
TName used to contain just a subset of the information stored in
TSymbol. It makes more sense to use TSymbol directly instead of
converting it to TName.
This also improves type safety a bit by making some functions only
take in TVariable or TFunction instead of the more generic TName.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Icb46923c25d33ebbbbc06ddc487da25957dda771
Reviewed-on: https://chromium-review.googlesource.com/829143
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index 2d3c14e..1f5dfa8 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -140,16 +140,6 @@
} // namespace anonymous
-TName::TName(const TString &name) : mName(name), mIsInternal(false)
-{
-}
-
-TName::TName(const TSymbol *symbol)
- : mName(symbol->symbolType() == SymbolType::Empty ? "" : symbol->name()),
- mIsInternal(symbol->symbolType() == SymbolType::AngleInternal)
-{
-}
-
////////////////////////////////////////////////////////////////
//
// Member functions of the nodes used for building the tree.
@@ -278,7 +268,7 @@
}
TIntermSymbol::TIntermSymbol(const TVariable *variable)
- : TIntermTyped(variable->getType()), mVariable(variable), mSymbol(variable)
+ : TIntermTyped(variable->getType()), mVariable(variable)
{
}
@@ -287,6 +277,11 @@
return mVariable->uniqueId();
}
+const TString &TIntermSymbol::getName() const
+{
+ return mVariable->name();
+}
+
TIntermAggregate *TIntermAggregate::CreateFunctionCall(const TFunction &func,
TIntermSequence *arguments)
{