1.1 --- a/lplc Fri Feb 24 00:02:46 2017 +0100
1.2 +++ b/lplc Fri Feb 24 13:25:05 2017 +0100
1.3 @@ -115,6 +115,8 @@
1.4 --no-env Equivalent to -E
1.5 -g Generate debugging information for the built executable
1.6 --debug Equivalent to -g
1.7 +-G Remove superfluous sections of the built executable
1.8 +--gc-sections Equivalent to -G
1.9 -P Show the module search path
1.10 --show-path Equivalent to -P
1.11 -q Silence messages produced when building an executable
1.12 @@ -170,6 +172,7 @@
1.13 # Determine the options and arguments.
1.14
1.15 debug = False
1.16 + gc_sections = False
1.17 ignore_env = False
1.18 make = True
1.19 make_verbose = True
1.20 @@ -192,6 +195,7 @@
1.21 if arg in ("-c", "--compile"): make = False
1.22 elif arg in ("-E", "--no-env"): ignore_env = True
1.23 elif arg in ("-g", "--debug"): debug = True
1.24 + elif arg in ("-G", "--gc-sections"): gc_sections = True
1.25 elif arg in ("-q", "--quiet"): make_verbose = False
1.26 elif arg in ("-r", "--reset"): reset = True
1.27 elif arg in ("-R", "--reset-all"): reset_all = True
1.28 @@ -284,7 +288,7 @@
1.29 if timings: now = stopwatch("Optimisation", now)
1.30
1.31 g = generator.Generator(i, o, generated_dir)
1.32 - g.to_output(debug)
1.33 + g.to_output(debug, gc_sections)
1.34
1.35 if timings: now = stopwatch("Generation", now)
1.36