We don't need to keep the param variable around for function prototypes.
Saves 20% memory for global symbol initialization
R=alokp@chromium.org
Review URL: https://codereview.appspot.com/9152043
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2233 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/glslang.y b/src/compiler/glslang.y
index b08dbad..6c6782e 100644
--- a/src/compiler/glslang.y
+++ b/src/compiler/glslang.y
@@ -967,9 +967,9 @@
const TParameter ¶m = function.getParam(i);
if (param.name != 0)
{
- TVariable *variable = new TVariable(param.name, *param.type);
+ TVariable variable(param.name, *param.type);
- prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), $1.line), $1.line);
+ prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), $1.line), $1.line);
}
else
{
diff --git a/src/compiler/glslang_tab.cpp b/src/compiler/glslang_tab.cpp
index f91625b..a29aadf 100644
--- a/src/compiler/glslang_tab.cpp
+++ b/src/compiler/glslang_tab.cpp
@@ -3088,9 +3088,9 @@
const TParameter ¶m = function.getParam(i);
if (param.name != 0)
{
- TVariable *variable = new TVariable(param.name, *param.type);
+ TVariable variable(param.name, *param.type);
- prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
+ prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
}
else
{