Moved code to unmangle function name to a common place and used it in both OutputGLSL and OutputHLSL.
Review URL: http://codereview.appspot.com/838041
git-svn-id: https://angleproject.googlecode.com/svn/trunk@83 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputGLSL.cpp b/src/compiler/OutputGLSL.cpp
index ee1f49d..7831b62 100644
--- a/src/compiler/OutputGLSL.cpp
+++ b/src/compiler/OutputGLSL.cpp
@@ -42,11 +42,6 @@
return TString(out.c_str());
}
-TString getUnmangledFunctionName(const TString& mangledName)
-{
- return TString(mangledName.c_str(), mangledName.find_first_of('('));
-}
-
TString getIndentationString(int depth)
{
TString indentation(depth, ' ');
@@ -344,7 +339,7 @@
if (visit == PreVisit)
{
TString returnType = node->getBasicString();
- TString functionName = getUnmangledFunctionName(node->getName());
+ TString functionName = TFunction::unmangleName(node->getName());
out << returnType << " " << functionName;
}
else if (visit == InVisit)
@@ -362,7 +357,7 @@
case EOpFunctionCall:
if (visit == PreVisit)
{
- TString functionName = getUnmangledFunctionName(node->getName());
+ TString functionName = TFunction::unmangleName(node->getName());
out << functionName << "(";
}
else if (visit == InVisit)