Store unmangled function names in the AST
This makes the code simpler across the board. There are a few cases
where mangled names still need to be generated in AST traversers, but
they are outweighed by much leaner output code for all function nodes.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Id3638e0fca6019bbbe6fc5e1b7763870591da2d8
Reviewed-on: https://chromium-review.googlesource.com/461077
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index bdd68f3..f469746 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -1443,11 +1443,9 @@
TIntermTyped *argument = (*(fnCall->getSequence()))[i]->getAsTyped();
if (!checkCanBeLValue(argument->getLine(), "assign", argument))
{
- TString unmangledName =
- TFunction::unmangleName(fnCall->getFunctionSymbolInfo()->getName());
error(argument->getLine(),
"Constant value cannot be passed for 'out' or 'inout' parameters.",
- unmangledName.c_str());
+ fnCall->getFunctionSymbolInfo()->getName().c_str());
return;
}
}
@@ -4277,16 +4275,13 @@
const TString &name = functionCall->getFunctionSymbolInfo()->getName();
TIntermNode *offset = nullptr;
TIntermSequence *arguments = functionCall->getSequence();
- if (name.compare(0, 16, "texelFetchOffset") == 0 ||
- name.compare(0, 16, "textureLodOffset") == 0 ||
- name.compare(0, 20, "textureProjLodOffset") == 0 ||
- name.compare(0, 17, "textureGradOffset") == 0 ||
- name.compare(0, 21, "textureProjGradOffset") == 0)
+ if (name == "texelFetchOffset" || name == "textureLodOffset" ||
+ name == "textureProjLodOffset" || name == "textureGradOffset" ||
+ name == "textureProjGradOffset")
{
offset = arguments->back();
}
- else if (name.compare(0, 13, "textureOffset") == 0 ||
- name.compare(0, 17, "textureProjOffset") == 0)
+ else if (name == "textureOffset" || name == "textureProjOffset")
{
// A bias parameter might follow the offset parameter.
ASSERT(arguments->size() >= 3);
@@ -4297,9 +4292,8 @@
TIntermConstantUnion *offsetConstantUnion = offset->getAsConstantUnion();
if (offset->getAsTyped()->getQualifier() != EvqConst || !offsetConstantUnion)
{
- TString unmangledName = TFunction::unmangleName(name);
error(functionCall->getLine(), "Texture offset must be a constant expression",
- unmangledName.c_str());
+ name.c_str());
}
else
{