diff --git a/src/compiler/compiler.ml b/src/compiler/compiler.ml index b0a7a1d1b19..078b63fa1a7 100644 --- a/src/compiler/compiler.ml +++ b/src/compiler/compiler.ml @@ -394,6 +394,7 @@ let compile ctx actx callbacks = if is_compilation then Generate.check_auxiliary_output com actx; enter_stage com CGenerationStart; ServerMessage.compiler_stage com; + Generate.maybe_generate_dump ctx tctx; if not actx.no_output then Generate.generate ctx tctx ext actx; enter_stage com CGenerationDone; ServerMessage.compiler_stage com; diff --git a/src/compiler/generate.ml b/src/compiler/generate.ml index e414e5882e0..6314126286a 100644 --- a/src/compiler/generate.ml +++ b/src/compiler/generate.ml @@ -95,12 +95,8 @@ let parse_swf_header ctx h = match ExtString.String.nsplit h ":" with let delete_file f = try Sys.remove f with _ -> () -let generate ctx tctx ext actx = +let maybe_generate_dump ctx tctx = let com = tctx.Typecore.com in - (* check file extension. In case of wrong commandline, we don't want - to accidentaly delete a source file. *) - if Path.file_extension com.file = ext then delete_file com.file; - if com.platform = Flash || com.platform = Cpp || com.platform = Hl then List.iter (Codegen.fix_overrides com) com.types; if Common.defined com Define.Dump then begin Codegen.Dump.dump_types com; Option.may Codegen.Dump.dump_types (com.get_macros()) @@ -110,7 +106,14 @@ let generate ctx tctx ext actx = if not com.is_macro_context then match tctx.Typecore.g.Typecore.macros with | None -> () | Some(_,ctx) -> Codegen.Dump.dump_dependencies ~target_override:(Some "macro") ctx.Typecore.com - end; + end + +let generate ctx tctx ext actx = + let com = tctx.Typecore.com in + (* check file extension. In case of wrong commandline, we don't want + to accidentaly delete a source file. *) + if Path.file_extension com.file = ext then delete_file com.file; + if com.platform = Flash || com.platform = Cpp || com.platform = Hl then List.iter (Codegen.fix_overrides com) com.types; begin match com.platform with | Neko | Hl | Eval when actx.interp -> () | Cpp when Common.defined com Define.Cppia -> ()