HLSL: Non-functional: consolidate function declarator information.

This commit is contained in:
John Kessenich
2017-03-11 17:55:28 -07:00
parent c04c6a4067
commit 088d52bac2
6 changed files with 43 additions and 33 deletions

View File

@@ -1414,7 +1414,7 @@ void HlslParseContext::assignLocations(TVariable& variable)
// Handle seeing a function declarator in the grammar. This is the precursor
// to recognizing a function prototype or function definition.
//
TFunction& HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction& function, bool prototype)
void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction& function, bool prototype)
{
//
// Multiple declarations of the same function name are allowed.
@@ -1442,13 +1442,6 @@ TFunction& HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFu
// other forms of name collisions.
if (! symbolTable.insert(function))
error(loc, "function name is redeclaration of existing name", function.getName().c_str(), "");
//
// If this is a redeclaration, it could also be a definition,
// in which case, we need to use the parameter names from this one, and not the one that's
// being redeclared. So, pass back this declaration, not the one in the symbol table.
//
return function;
}
// Add interstage IO variables to the linkage in canonical order.