Skip to content

Commit

Permalink
Use proper has_side_effect check for local dce.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Dec 15, 2014
1 parent 596dedb commit 08c8ea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion analyzer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ module LocalDce = struct
| TVar(v,None) -> is_used v
| TVar(v,Some e1) -> is_used v || Optimizer.has_side_effect e1
| TBinop(OpAssign,{eexpr = TLocal v},e2) -> is_used v || Optimizer.has_side_effect e2
| _ -> true
| _ -> Optimizer.has_side_effect e
in
let rec collect e = match e.eexpr with
| TLocal v ->
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestDCE.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package unit;

@:analyzer(no_check_has_effect)
@:analyzer(no_check_has_effect, no_local_dce)
class DCEClass {
// used statics
static function staticUsed() { }
Expand Down

0 comments on commit 08c8ea7

Please sign in to comment.