Remove some unused code.

This seemed to be aimed at supporting lazy allocation of symbol tables. That could be a useful optimization, but the code that existed was incomplete and did not do anything useful. That or similar code could be reintroduced as part of a full implementation of lazy allocation, if it is ever done.
This commit is contained in:
Stephen Heumann 2022-10-30 15:06:28 -05:00
parent f31b5ea1e6
commit d4c4d18a55

View File

@ -22,7 +22,6 @@
{ } { }
{ External Variables: } { External Variables: }
{ } { }
{ noDeclarations - have we declared anything at this level? }
{ table - current symbol table } { table - current symbol table }
{ } { }
{ charPtr - pointer to the base type for char } { charPtr - pointer to the base type for char }
@ -79,7 +78,6 @@ type
end; end;
var var
noDeclarations: boolean; {have we declared anything at this level?}
table: symbolTablePtr; {current symbol table} table: symbolTablePtr; {current symbol table}
globalTable: symbolTablePtr; {global symbol table} globalTable: symbolTablePtr; {global symbol table}
functionTable: symbolTablePtr; {table for top level of current function} functionTable: symbolTablePtr; {table for top level of current function}
@ -1465,7 +1463,6 @@ staticNum := '~0000'; {no functions processed}
table := nil; {initialize the global symbol table} table := nil; {initialize the global symbol table}
PushTable; PushTable;
globalTable := table; globalTable := table;
noDeclarations := false;
functionTable := nil; functionTable := nil;
{declare base types} {declare base types}
new(sCharPtr); {signed char} new(sCharPtr); {signed char}
@ -2055,22 +2052,16 @@ if space <> fieldListSpace then begin {are we defining a function?}
and (itype^.fieldList = nil) and doingParameters then begin and (itype^.fieldList = nil) and doingParameters then begin
useGlobalPool := true; useGlobalPool := true;
end; {else if} end; {else if}
if noDeclarations then begin {if we need a symbol table, create it} cs := FindSymbol(tk, space, true, false); {check for duplicates}
if not isGlobal then if cs <> nil then begin
noDeclarations := false; if (not CompTypes(cs^.itype, itype))
end {if} or ((cs^.state = initialized) and (state = initialized))
else begin {check for duplicates} or (globalTable <> table) then
cs := FindSymbol(tk, space, true, false); if (not doingParameters) or (cs^.state <> declared) then
if cs <> nil then begin Error(42);
if (not CompTypes(cs^.itype, itype)) p := cs;
or ((cs^.state = initialized) and (state = initialized)) needSymbol := false;
or (globalTable <> table) then end; {if}
if (not doingParameters) or (cs^.state <> declared) then
Error(42);
p := cs;
needSymbol := false;
end; {if}
end; {else}
end; {if} end; {if}
if class = staticsy then {statics go in the global symbol table} if class = staticsy then {statics go in the global symbol table}
if not isGLobal then if not isGLobal then