Fix issue for new unique id system. Add level bits to help verifying symbols and split symbol tables.

For intermediates rebuilding, now need manually amending level bits for redeclaring built-ins.
This commit is contained in:
Chow 2020-11-12 15:54:16 +08:00
parent 74e8f05b9f
commit 93b400f267
17 changed files with 110 additions and 71 deletions

View file

@ -4274,8 +4274,10 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
// If it wasn't at a built-in level, then it's already been redeclared;
// that is, this is a redeclaration of a redeclaration; reuse that initial
// redeclaration. Otherwise, make the new one.
if (builtIn)
if (builtIn) {
makeEditable(symbol);
symbolTable.amendSymbolIdLevel(*symbol);
}
// Now, modify the type of the copy, as per the type of the current redeclaration.
@ -4804,7 +4806,7 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init,
}
// get the unique id of the loop index
int loopIndex = binaryInit->getLeft()->getAsSymbolNode()->getId();
long long loopIndex = binaryInit->getLeft()->getAsSymbolNode()->getId();
inductiveLoopIds.insert(loopIndex);
// condition's form must be "loop-index relational-operator constant-expression"