Clean variable symbols as well
Even though it is kind of ass (a variable is considered used even if it simply has a single definition statement)...
This commit is contained in:
parent
085e04798e
commit
d00036ff8e
1 changed files with 10 additions and 1 deletions
|
@ -89,7 +89,7 @@ namespace arookas {
|
|||
void CleanSymbols() {
|
||||
var i = 0;
|
||||
while (i < mContext.SymbolTable.Count) {
|
||||
if (mContext.SymbolTable[i] is sunCallableSymbol && !mContext.SymbolTable[i].HasRelocations) {
|
||||
if (!mContext.SymbolTable[i].HasRelocations) {
|
||||
mContext.SymbolTable.RemoveAt(i);
|
||||
continue;
|
||||
}
|
||||
|
@ -102,6 +102,15 @@ namespace arookas {
|
|||
}
|
||||
builtin.Index = i;
|
||||
}
|
||||
var vars = 0;
|
||||
for (i = 0; i < mContext.SymbolTable.Count; ++i) {
|
||||
var variable = mContext.SymbolTable[i] as sunVariableSymbol;
|
||||
if (variable == null) {
|
||||
continue;
|
||||
}
|
||||
variable.Display = 0;
|
||||
variable.Index = vars++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void CompileRelocations() {
|
||||
|
|
Loading…
Reference in a new issue