Browse Source

don't let display modes make it to generation

Simon Krajewski 9 năm trước cách đây
mục cha
commit
0a88436a6c
2 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 1
      src/main.ml
  2. 0 4
      src/optimization/filters.ml

+ 5 - 1
src/main.ml

@@ -1566,7 +1566,7 @@ try
 		t();
 		t();
 		if ctx.has_error then raise Abort;
 		if ctx.has_error then raise Abort;
 		begin match com.display with
 		begin match com.display with
-			| DMNone | DMUsage | DMPosition | DMType | DMResolve _ ->
+			| DMNone | DMUsage ->
 				()
 				()
 			| _ ->
 			| _ ->
 				if ctx.has_next then raise Abort;
 				if ctx.has_next then raise Abort;
@@ -1577,6 +1577,10 @@ try
 		com.main <- main;
 		com.main <- main;
 		com.types <- types;
 		com.types <- types;
 		com.modules <- modules;
 		com.modules <- modules;
+		begin match com.display with
+			| DMUsage -> Codegen.detect_usage com;
+			| _ -> ()
+		end;
 		Filters.run com tctx main;
 		Filters.run com tctx main;
 		if ctx.has_error then raise Abort;
 		if ctx.has_error then raise Abort;
 		(* check file extension. In case of wrong commandline, we don't want
 		(* check file extension. In case of wrong commandline, we don't want

+ 0 - 4
src/optimization/filters.ml

@@ -1025,10 +1025,6 @@ let iter_expressions fl mt =
 		()
 		()
 
 
 let run com tctx main =
 let run com tctx main =
-	begin match com.display with
-		| DMUsage -> Codegen.detect_usage com;
-		| _ -> ()
-	end;
 	if not (Common.defined com Define.NoDeprecationWarnings) then
 	if not (Common.defined com Define.NoDeprecationWarnings) then
 		Codegen.DeprecationCheck.run com;
 		Codegen.DeprecationCheck.run com;
 	let new_types = List.filter (fun t -> not (is_cached t)) com.types in
 	let new_types = List.filter (fun t -> not (is_cached t)) com.types in