More subtle checking for redeclarations:

- 300 doesn't allow built-in overload, while 100 does, while neither allows redefining
 - block name can't be reused for block name within the same interface 
   (though, the spec. isn't clear about that, it's easier than verifying member matches, will file bug on it)


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23984 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-11-11 04:21:31 +00:00
parent 4d6570a1b3
commit a4351c55e8
15 changed files with 332 additions and 243 deletions

View file

@ -292,9 +292,8 @@ public:
return isOkay;
} else {
// Check for redefinition errors:
// - STL itself will tell us if there is a direct name collision at this level
// - additionally, check for function/variable name collisions
// - for ES, for overriding or hiding built-in function
// - STL itself will tell us if there is a direct name collision, with name mangling, at this level
// - additionally, check for function-redefining-variable name collisions
const TString& insertName = symbol.getMangledName();
if (symbol.getAsFunction()) {
// make sure there isn't a variable of this name
@ -457,11 +456,13 @@ public:
{
symbol.setUniqueId(++uniqueId);
if (! symbol.getAsFunction()) {
// make sure there isn't a function of this name
if (table[currentLevel()]->hasFunctionName(symbol.getName()))
return false;
if (atGlobalLevel() && currentLevel() > 0 && noBuiltInRedeclarations) {
// make sure there isn't a function of this variable name
if (! symbol.getAsFunction() && table[currentLevel()]->hasFunctionName(symbol.getName()))
return false;
// check for not overloading or redefining a built-in function
if (noBuiltInRedeclarations) {
if (atGlobalLevel() && currentLevel() > 0) {
if (table[0]->hasFunctionName(symbol.getName()))
return false;
if (currentLevel() > 1 && table[1]->hasFunctionName(symbol.getName()))