Always use TFunction instead of TFunctionSymbolInfo
This reduces unnecessary memory allocations and conversions between
different objects containing the same data.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I87316509ab1cd6d36756ff6af7fa2b5c5a76a8ea
Reviewed-on: https://chromium-review.googlesource.com/827134
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 40372c6..739f686 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -1723,7 +1723,7 @@
ASSERT(mCurrentFunctionMetadata == nullptr);
- size_t index = mCallDag.findIndex(node->getFunctionSymbolInfo()->getId());
+ size_t index = mCallDag.findIndex(node->getFunction()->uniqueId());
ASSERT(index != CallDAG::InvalidIndex);
mCurrentFunctionMetadata = &mASTMetadataList[index];
@@ -1731,14 +1731,14 @@
TIntermSequence *parameters = node->getFunctionPrototype()->getSequence();
- if (node->getFunctionSymbolInfo()->isMain())
+ if (node->getFunction()->isMain())
{
out << "gl_main(";
}
else
{
- out << DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj())
- << DisambiguateFunctionName(parameters) << (mOutputLod0Function ? "Lod0(" : "(");
+ out << DecorateFunctionIfNeeded(node->getFunction()) << DisambiguateFunctionName(parameters)
+ << (mOutputLod0Function ? "Lod0(" : "(");
}
for (unsigned int i = 0; i < parameters->size(); i++)
@@ -1772,7 +1772,7 @@
bool needsLod0 = mASTMetadataList[index].mNeedsLod0;
if (needsLod0 && !mOutputLod0Function && mShaderType == GL_FRAGMENT_SHADER)
{
- ASSERT(!node->getFunctionSymbolInfo()->isMain());
+ ASSERT(!node->getFunction()->isMain());
mOutputLod0Function = true;
node->traverse(this);
mOutputLod0Function = false;
@@ -1851,7 +1851,7 @@
TInfoSinkBase &out = getInfoSink();
ASSERT(visit == PreVisit);
- size_t index = mCallDag.findIndex(node->getFunctionSymbolInfo()->getId());
+ size_t index = mCallDag.findIndex(node->getFunction()->uniqueId());
// Skip the prototype if it is not implemented (and thus not used)
if (index == CallDAG::InvalidIndex)
{
@@ -1860,7 +1860,7 @@
TIntermSequence *arguments = node->getSequence();
- TString name = DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
+ TString name = DecorateFunctionIfNeeded(node->getFunction());
out << TypeString(node->getType()) << " " << name << DisambiguateFunctionName(arguments)
<< (mOutputLod0Function ? "Lod0(" : "(");
@@ -1914,7 +1914,7 @@
ASSERT(index != CallDAG::InvalidIndex);
lod0 &= mASTMetadataList[index].mNeedsLod0;
- out << DecorateFunctionIfNeeded(TName(node->getFunction()));
+ out << DecorateFunctionIfNeeded(node->getFunction());
out << DisambiguateFunctionName(node->getSequence());
out << (lod0 ? "Lod0(" : "(");
}
@@ -1922,7 +1922,7 @@
{
// This path is used for internal functions that don't have their definitions in the
// AST, such as precision emulation functions.
- out << DecorateFunctionIfNeeded(TName(node->getFunction())) << "(";
+ out << DecorateFunctionIfNeeded(node->getFunction()) << "(";
}
else if (node->getFunction()->isImageFunction())
{