Added clean-functions option
This commit is contained in:
parent
a51c5d9e8b
commit
5de905e9e5
3 changed files with 17 additions and 1 deletions
|
@ -5,6 +5,11 @@ newoption {
|
||||||
value = "PATH"
|
value = "PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "clean-functions",
|
||||||
|
description = "Compiles only used functions"
|
||||||
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "clean-symbols",
|
trigger = "clean-symbols",
|
||||||
description = "Cleans up the symbol table from unused symbols"
|
description = "Cleans up the symbol table from unused symbols"
|
||||||
|
@ -40,6 +45,9 @@ workspace "ssc"
|
||||||
links { "System", "arookas", "grammatica-1.6" }
|
links { "System", "arookas", "grammatica-1.6" }
|
||||||
|
|
||||||
-- apply options
|
-- apply options
|
||||||
|
if _OPTIONS["clean-functions"] then
|
||||||
|
defines { "SSC_CLEAN_FUNCTIONS" }
|
||||||
|
end
|
||||||
if _OPTIONS["clean-symbols"] then
|
if _OPTIONS["clean-symbols"] then
|
||||||
defines { "SSC_CLEAN_SYMBOLS" }
|
defines { "SSC_CLEAN_SYMBOLS" }
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,6 +68,7 @@ There are also options which are able to be configured via the premake5 command
|
||||||
|Option|Description|
|
|Option|Description|
|
||||||
|------|-----------|
|
|------|-----------|
|
||||||
|lib-dir|Sets the path to the dependencies. Defaults to the _lib/_ folder.|
|
|lib-dir|Sets the path to the dependencies. Defaults to the _lib/_ folder.|
|
||||||
|
|clean-functions|Compiles only used functions.|
|
||||||
|clean-symbols|Cleans symbol table of unused symbols.|
|
|clean-symbols|Cleans symbol table of unused symbols.|
|
||||||
|
|
||||||
## Language
|
## Language
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace arookas {
|
namespace arookas {
|
||||||
public class sunCompiler {
|
public class sunCompiler {
|
||||||
|
@ -85,6 +84,7 @@ namespace arookas {
|
||||||
}
|
}
|
||||||
mBinary.WriteEND();
|
mBinary.WriteEND();
|
||||||
}
|
}
|
||||||
|
#if SSC_CLEAN_FUNCTIONS
|
||||||
void CompileFunctions() {
|
void CompileFunctions() {
|
||||||
while (DoCompileFunctions() > 0) ;
|
while (DoCompileFunctions() > 0) ;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,13 @@ namespace arookas {
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void CompileFunctions() {
|
||||||
|
foreach (var callable in mContext.SymbolTable.Get<sunCallableSymbol>()) {
|
||||||
|
callable.Compile(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if SSC_CLEAN_SYMBOLS
|
#if SSC_CLEAN_SYMBOLS
|
||||||
void CleanSymbols() {
|
void CleanSymbols() {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue