Skip to content

Commit

Permalink
Remove unused local bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Jun 19, 2014
1 parent 1e4e52a commit 16568df
Show file tree
Hide file tree
Showing 25 changed files with 16 additions and 70 deletions.
1 change: 0 additions & 1 deletion sources/dfmc/back-end/heaps.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ end method;
define method export-references
(heap :: <model-heap>, e :: <&macro>, ct?) => ()
let object = expander-macro-object(e);
let def = model-has-definition?(e);
// The following isn't true for procedural macros...
if (instance?(object, <macro-descriptor>))
let referenced-names = macro-referenced-names(object);
Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/browser-support/glue-routines.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ end function;

define function class-binding-in-context
(context :: dfmc-<library-description>, form :: <class-definition>)
let var = dfmc-form-variable-name(form);
unless (dfmc-form-ignored?(form))
dfmc-form-variable-binding(form)
end;
Expand Down
9 changes: 0 additions & 9 deletions sources/dfmc/c-ffi/c-struct-macro.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,6 @@ define method expand-slot-accessor
length-expression: slot-rep.array-length);
len := 1;
end unless;
let max-index = len - 1;
// TODO: bogus use of model-class-name
let struct-name = struct-descriptor.model-class-name;
let slot-pointer-type-name = slot-rep.maybe-slot-pointer-type-name;
Expand Down Expand Up @@ -1409,7 +1408,6 @@ define method expand-slot-accessor
length-expression: slot-rep.array-length);
len := 1;
end unless;
let max-index = len - 1;
// TODO: bogus use of model-class-name
let struct-name = struct-descriptor.model-class-name;
let names = method-argument-names(m);
Expand Down Expand Up @@ -1527,8 +1525,6 @@ define method expand-slot-accessor
let dereferencer
= ^bitfield-dereferencer-name(model-slot-type);
let import = ^import-function(model-slot-type) | #{ identity };
// TODO: bogus use of model-class-name
let struct-name = struct-descriptor.model-class-name;
let names = method-argument-names(m);
let (byte-offset, bit-offset, bit-size) =
compute-aggregate-field-offset
Expand Down Expand Up @@ -1560,8 +1556,6 @@ define method expand-slot-accessor
let unboxer = ^unboxer-function-name(model-slot-type);
let dereferencer
= ^bitfield-dereferencer-name(model-slot-type);
// TODO: bogus use of model-class-name
let struct-name = struct-descriptor.model-class-name;
let names = method-argument-names(m);
let (byte-offset, bit-offset, bit-size) =
compute-aggregate-field-offset
Expand Down Expand Up @@ -1603,7 +1597,6 @@ define method expand-slot-accessor
length-expression: slot-rep.array-length);
len := 1;
end unless;
let max-index = len - 1;
let names = method-argument-names(m);
let (struct, offset) = values(names[0], names[1]);
// TODO: check bounds by using limited specializer
Expand Down Expand Up @@ -1636,7 +1629,6 @@ define method expand-slot-accessor
let dereferencer = ^raw-dereferencer-name(model-slot-type);
// TODO: bogus use of model-class-name
let struct-name = struct-descriptor.model-class-name;
let len = array-length(slot-rep);
let len = ^top-level-eval(array-length(slot-rep));
unless (instance?(len, <integer>) & len > 0)
note(<invalid-array-slot-bounds>,
Expand All @@ -1645,7 +1637,6 @@ define method expand-slot-accessor
length-expression: slot-rep.array-length);
len := 1;
end unless;
let max-index = len - 1;
let names = method-argument-names(m);
let (new-value, struct, offset) = values(names[0], names[1], names[2]);
// TODO: check bounds by using limited specializer
Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/c-ffi/offsets.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ define method compute-aggregate-alignment
let pack-option
= get-property(raw-type.raw-options, #"pack",
default: get-default-pack-option());
let fields = raw-type.raw-fields;
for (field :: <abstract-aggregate-field-indicator> in raw-type.raw-fields)
let field-type = field.field-raw-type;
let field-align = raw-type-info-alignment(field-type);
Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/conversion/convert-c-ffi.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ define method convert-lambda-into*
(env :: <environment>, f :: <&c-callable-function>, the-body,
#key multiple-values? = #f)
let sig-spec = f.signature-spec;
let required = spec-argument-required-variable-specs(sig-spec);
let (ffi-signature, signature) = make-ffi-signature(sig-spec);
f.c-signature := ffi-signature;
next-method(env, f, the-body, multiple-values?: #f);
Expand Down
8 changes: 4 additions & 4 deletions sources/dfmc/conversion/convert.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,14 @@ end function;

define inline function make-object-reference
(object) => (ref :: <value-reference>)
let (ignore-first, ignore-last, ref)
let (_, _, ref)
= convert-object-reference-1($top-level-environment, object);
ref
end function;

define inline function make-value-reference
(object, ref-class :: <class>) => (ref :: <value-reference>)
let (ignore-first, ignore-last, ref)
let (_, _, ref)
= convert-value-reference($top-level-environment, $single, object, ref-class);
ref
end function;
Expand Down Expand Up @@ -672,7 +672,7 @@ end function;

define inline function make-global-reference
(name :: <variable-name-fragment>) => (ref :: <value-reference>);
let (ignore-first, ignore-last, ref)
let (_, _, ref)
= convert-global-reference($top-level-environment, name);
ref
end function;
Expand All @@ -685,7 +685,7 @@ end function;

define inline function make-dylan-reference
(name :: <name>) => (ref :: <value-reference>);
let (ignore-first, ignore-last, ref)
let (_, _, ref)
= convert-dylan-reference(name);
ref
end function;
Expand Down
2 changes: 0 additions & 2 deletions sources/dfmc/conversion/define-binding.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ define compiler-sideways method compute-and-install-form-model-objects
// Type infer init-model
type-estimate(init-model);
run-compilation-passes(init-model);
let complete? :: <boolean> = #t ;
unless(empty-method?(init-model))
form-init-method(form) := init-model;
complete? := #f ;
end;
// now set definitions where appropriate
for (variable-name in names)
Expand Down
2 changes: 0 additions & 2 deletions sources/dfmc/conversion/define-class-mop.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,6 @@ define method ^make-mm-wrapper (class :: <&class>)
= if (repeated-slot)
let repeated-type
= repeated-slot.^slot-type;
let byte?
= repeated-representation-byte?(repeated-type);
let repeated-size
= repeated-representation-size(repeated-type);
let non-word?
Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/conversion/define-domain.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ define method compute-and-install-form-model-objects-statically
compute-and-install-form-dynamic-init-method(form)
else
form-model(form) := model;
let lib = library-description-model(form-library(form));
let domain-locally-defined? = form-library(gf-def) == form-library(form);
let gf-runtime-sealed? = (form-sealable?(gf-def) | form-compiler-open?(gf-def));

Expand Down
2 changes: 0 additions & 2 deletions sources/dfmc/debug-back-end/print-flow-graph.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ end method;

define method print-computations
(stream :: <stream>, first :: <computation>, #key before: last) => ();
let next = #f;
for-computations (c from first before last)
indent(stream, *offset*);
format(stream, "%=\n", c);
next := c.next-computation;
end for-computations;
end method print-computations;

Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/management/back-end-driver.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ define method tightly-link-library-heaps
(description :: <project-library-description>,
#rest flags, #key skip-link?, skip-emit?, #all-keys)
=> (data-size :: <integer>, code-size :: <integer>)
let model-heap-size = 0;
if (*combine-object-files?*)
let name = concatenate("_",
as(<string>,
Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/management/world.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ define sideways method ensure-export-only (ld :: <library-description>)

without-dependency-tracking
let library-bindings = namespace-local-bindings(library);
let visible-bindings = make(<object-table>);
let queue = make(<deque>);
// establish visibility sets
let visible-bindings = make(<object-set>);
Expand Down
13 changes: 3 additions & 10 deletions sources/dfmc/optimization/calls.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ define method do-primitive-move-log-coercion
(env :: <environment>,
c :: <primitive-call>, call-args :: <argument-sequence>)
let arg-0 = call-args[0];
let arg-1 = call-args[1];
let constant? = fast-constant-value?(arg-1);
do-primitive-move-coercion(env, c, arg-0, generator(arg-0))
end method;

Expand Down Expand Up @@ -231,7 +229,6 @@ define method do-primitive-coercion-inverses
(env :: <environment>, call, arg, arg-gen :: <binary-merge>,
inverse-coercion, kind)
// only do this optimization if we push unboxing into the loop
let tmp = temporary(arg-gen);
if (kind == #"forward")

let merge-node = arg-gen;
Expand Down Expand Up @@ -533,7 +530,7 @@ define method do-optimize-machine-word-partial-fold-binary-op
if (constant?)
let combined-value = combine(value-1, value-2);
if (combined-value)
let (ignore-first, ignore-last, new-arg-1)
let (_, _, new-arg-1)
= convert-object-reference-1(env, combined-value);
// format-out("PARTIAL-FOLD %= %= -> %=\n", value-1, value-2, combined-value);
replace-call-argument!(call, first(arguments(gen)), 0);
Expand Down Expand Up @@ -569,7 +566,6 @@ define method machine-word-primitives-call-to-and-arguments?
(env :: <environment>, call :: <primitive-call>, test :: <function>,
#rest primitive-names)
=> (ref :: false-or(<value-reference>))
let primitive-call = call;
let number-primitives = size(primitive-names);
let test-arguments :: <simple-object-vector>
= make(<vector>, size: number-primitives);
Expand Down Expand Up @@ -881,7 +877,7 @@ define method do-optimize-primitive-machine-word-bit-field-extract
if (constant?)
let size = as(<integer>, ^raw-object-value(raw-size));
let mask = ash(1, size) - 1;
let (ignore-first, ignore-last, mask-ref)
let (_, _, mask-ref)
= convert-object-reference-1(env, make-raw-literal(mask));
let (call-c, call-t)
= make-with-temporary
Expand Down Expand Up @@ -1012,7 +1008,6 @@ define &optimizer-function apply (env, call, arguments)
end &optimizer-function;

define method do-optimize-size (env :: <environment>, call, call-args)
let env = call.environment;
let arg = call-args[0];
if (instance?(arg, <stack-vector-temporary>))
replace-call-with-values(list(number-values(arg)), call, temporary(call));
Expand All @@ -1029,7 +1024,6 @@ define &optimizer-function size (env, call, arguments)
end &optimizer-function;

define method do-optimize-dimensions (env :: <environment>, call, call-args)
let env = call.environment;
let arg = call-args[0];
let type = type-estimate(arg);
if (instance?(type, <type-estimate-limited-collection>)
Expand All @@ -1045,7 +1039,6 @@ define &optimizer-function dimensions (env, call, arguments)
end &optimizer-function;

define method do-optimize-element-type (env :: <environment>, call, call-args)
let env = call.environment;
let arg = call-args[0];
let type = type-estimate(arg);
if (instance?(type, <type-estimate-limited-collection>))
Expand Down Expand Up @@ -1249,7 +1242,7 @@ define &optimizer-function allocate-instance
end if;
if (^repeated-slot-descriptor(class)) return(#f) end;
// We have a simplish class.
let (no-op1, no-op2, allocator-ref)
let (_, _, allocator-ref)
= convert-object-reference-1
(call.environment, dylan-value(#"system-allocate-simple-instance"));
let (allocate-call, allocate-tmp)
Expand Down
5 changes: 0 additions & 5 deletions sources/dfmc/optimization/constant-folding.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ define method fold-if-merge!
(c :: <if>, sav-first :: <computation>, sav-last :: <computation>,
sav-value :: false-or(<value-reference>), del-first :: <computation>)
=> ()
let f = lambda(environment(c));
let merge-c = next-computation(c);
// SPLICE SAVED BRANCH BEGINNING IN PLACE OF IF
let pc = previous-computation(c);
Expand Down Expand Up @@ -128,8 +127,6 @@ define method constant-fold (c :: <binary-merge>)
let left-value = merge-left-value(c);
let right-value = merge-right-value(c);
if (left-value & right-value)
let left-g = generator(left-value);
let right-g = generator(right-value);
if (left-value == right-value |
guaranteed-joint?(type-estimate(left-value),
dylan-value(#"<bottom>")))
Expand Down Expand Up @@ -960,7 +957,6 @@ define method constant-fold (c :: <check-type-computation>)

// Insert at the end of the branch, and redirect the merge to
// refer to its value.
let left-c = merge-left-previous-computation(merge-c);
insert-computation-before-reference!(merge-c, left-check, left-ref);
merge-replace-left-value!(merge-c, left-ref, left-check.temporary);

Expand All @@ -971,7 +967,6 @@ define method constant-fold (c :: <check-type-computation>)

// Insert at the end of the branch, and redirect the merge to
// refer to its value.
let right-c = merge-right-previous-computation(merge-c);
insert-computation-before-reference!(merge-c, right-check, right-ref);
merge-replace-right-value!(merge-c, right-ref, right-check.temporary);

Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/optimization/dynamic-extent.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ define function color-extent(f :: <&method>, extent :: <dynamic-extent>)
end;

let reqs = sig-spec.spec-argument-required-variable-specs;
let keys = sig-spec.spec-argument-key-variable-specs;

let reqs-size = reqs.size;

Expand Down
1 change: 0 additions & 1 deletion sources/dfmc/optimization/inlining.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ define compiler-sideways method copy-down-body (m :: <&copy-down-method>) => ()
end if;

let bind-comp = m.body ;
let return-t = return-c.computation-value ;

return-c.previous-computation := #f ;

Expand Down
2 changes: 0 additions & 2 deletions sources/dfmc/optimization/non-local-exit.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ define method analyze-non-local-exits (lambda :: <&lambda>) => ()
end method;

define method analyze-entry (entry :: <entry-state>) => ()
for (exit in entry.exits)
end for;
#f
end method;
1 change: 0 additions & 1 deletion sources/environment/commands/basic-commands.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ define function print-table
max(max-size, size(item.label-key))
end,
0, items);
let padding = make(<byte-string>, size: tab-column, fill: ' ');
local method item-label<
(item1, item2) => (true? :: <boolean>)
item1.label-key < item2.label-key
Expand Down
2 changes: 0 additions & 2 deletions sources/environment/commands/library-packs.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ end command-property examples;
define method show-property
(context :: <environment-context>, property :: <examples-property>)
=> ()
let stream = context.context-server.server-output-stream;
for (info :: <library-pack-info> in installed-library-packs())
if (instance?(info, <basic-library-pack-info>))
describe-libraries(context, format-to-string("%s Examples", info.info-title),
Expand All @@ -94,7 +93,6 @@ end command-property test-suites;
define method show-property
(context :: <environment-context>, property :: <test-suites-property>)
=> ()
let stream = context.context-server.server-output-stream;
for (info :: <library-pack-info> in installed-library-packs())
if (instance?(info, <basic-library-pack-info>))
describe-libraries(context, format-to-string("%s test suites", info.info-title),
Expand Down
20 changes: 9 additions & 11 deletions sources/environment/commands/projects.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,15 @@ define sealed method do-execute-command
error-handler: curry(compiler-condition-handler, context));
project.project-opened-by-user? := #t;
context.context-project := project;
let project-context
= context.context-project-context
| begin
let library = project.project-library;
let module = library & library-default-module(project, library);
let project-context
= make(<project-context>,
project: project,
module: module);
context.context-project-context := project-context
end;
unless (context.context-project-context)
let library = project.project-library;
let module = library & library-default-module(project, library);
let project-context
= make(<project-context>,
project: project,
module: module);
context.context-project-context := project-context
end unless;
message(context, "Opened project %s (%s)", project.project-name,
project.project-filename);
project;
Expand Down
2 changes: 0 additions & 2 deletions sources/environment/dfmc/database/class-objects.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ define sealed method do-direct-superclasses
(function :: <function>, server :: <dfmc-database>, class :: <class-object>,
#key client)
=> ()
let project-object = server.server-project;
let class-definition :: <class-definition> = class.compiler-object-proxy;
let context = browsing-context(server, class-definition);
let direct-superclasses = class-definition.class-definition-superclass-types;
do(method (superclass-type) => ()
let type-object = make-environment-object-for-type-expression(server, superclass-type);
Expand Down
3 changes: 0 additions & 3 deletions sources/environment/dfmc/database/function-objects.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ define sealed method function-parameters
let function-definition :: false-or(<definition>)
= compiler-object-proxy(function);
if (function-definition)
let project = server-project(server);
let (req-vars, rest-var, next-var, key-vars, value-vars, rest-value-var)
= functional-parameters(function-definition);
let (req-types, rest-type, next-type, key-types, value-types, rest-value-type)
Expand Down Expand Up @@ -147,7 +146,6 @@ define sealed method method-specializers
=> (specializers :: <sequence>)
let specializers = make(<stretchy-vector>);
let definition = object.compiler-object-proxy;
let context = browsing-context(server, definition);

let req-types //...rest-type, next-type, key-types, value-types, rest-value-type)
= functional-parameter-types(definition);
Expand Down Expand Up @@ -220,7 +218,6 @@ end method method-generic-function;
define sealed method do-method-definition-specializers
(function :: <function>, server :: <dfmc-database>, definition :: <definition>)
=> ()
let context = browsing-context(server, definition);
let req-types //...rest-type, next-type, key-types, value-types, rest-value-type)
= functional-parameter-types(definition);
if (req-types)
Expand Down
Loading

0 comments on commit 16568df

Please sign in to comment.