aboutsummaryrefslogtreecommitdiff
path: root/glslang/MachineIndependent/SymbolTable.h
diff options
context:
space:
mode:
authorJohn Kessenich <cepheus@frii.com>2013-10-24 01:25:40 +0000
committerJohn Kessenich <cepheus@frii.com>2013-10-24 01:25:40 +0000
commitab41fe5df6dd7e357ec29009352d66ffa480d014 (patch)
tree00418fff51e7f06c43ceb34109d87d9c8f09a896 /glslang/MachineIndependent/SymbolTable.h
parent94fdd1117b9268c0421eec1682d1b07f3366e3a7 (diff)
downloadglslang-ab41fe5df6dd7e357ec29009352d66ffa480d014.tar.gz
Add redeclarations of built-in blocks.
Note: lots of test results changed due to listing the members of a block when printing types. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23682 e7fa87d3-cd2b-0410-9028-fcbf551c1848
Diffstat (limited to 'glslang/MachineIndependent/SymbolTable.h')
-rw-r--r--glslang/MachineIndependent/SymbolTable.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/glslang/MachineIndependent/SymbolTable.h b/glslang/MachineIndependent/SymbolTable.h
index 0758a1cc..9da46267 100644
--- a/glslang/MachineIndependent/SymbolTable.h
+++ b/glslang/MachineIndependent/SymbolTable.h
@@ -463,13 +463,11 @@ public:
// to the current level, so it can be modified without impacting other users
// of the shared table.
//
- TSymbol* copyUp(TSymbol* shared)
+ TSymbol* copyUpDeferredInsert(TSymbol* shared)
{
- TSymbol* copy;
if (shared->getAsVariable()) {
- copy = shared->clone();
+ TSymbol* copy = shared->clone();
copy->setUniqueId(shared->getUniqueId());
- table[currentLevel()]->insert(*copy);
return copy;
} else {
const TAnonMember* anon = shared->getAsAnonMember();
@@ -477,7 +475,20 @@ public:
TVariable* container = anon->getAnonContainer().clone();
container->changeName(NewPoolTString(""));
container->setUniqueId(anon->getAnonContainer().getUniqueId());
- table[currentLevel()]->insert(*container);
+ return container;
+ }
+ }
+
+ TSymbol* copyUp(TSymbol* shared)
+ {
+ TSymbol* copy = copyUpDeferredInsert(shared);
+ table[currentLevel()]->insert(*copy);
+ if (shared->getAsVariable())
+ return copy;
+ else {
+ // get copy of an anonymous member's container
+ table[currentLevel()]->insert(*copy);
+ // return the copy of the anonymous member
return table[currentLevel()]->find(shared->getName());
}
}