Nicolas Cannasse 17 anni fa
parent
commit
cf656bb597
3 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 1 0
      doc/CHANGES.txt
  2. 1 0
      main.ml
  3. 5 1
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -18,6 +18,7 @@
 	fix for protected as3 classes
 	added support for flash9 XML (in flash.xml package)
 	added neko.vm.Tls for Neko 1.6.1
+	added --no-inline
 
 2008-01-13: 1.17
 	fixed Int32.compare, added Int32.read and Int32.write

+ 1 - 0
main.ml

@@ -357,6 +357,7 @@ try
 		),": display code tips");
 		("--no-output", Arg.Unit (fun() -> no_output := true),": compiles but does not generate any file");
 		("--times", Arg.Unit (fun() -> Plugin.times := true),": mesure compilation times");
+		("--no-inline", Arg.Unit (fun() -> Plugin.define "no_inline"),": disable inlining");
 	] in
 	let current = ref 0 in
 	let args = Array.of_list ("" :: params) in

+ 5 - 1
typer.ml

@@ -36,6 +36,7 @@ type context = {
 	warn : string -> pos -> unit;
 	error : error_msg -> pos -> unit;
 	flash9 : bool;
+	doinline : bool;
 	mutable std : module_def;
 	mutable untyped : bool;
 	mutable isproxy : bool;
@@ -143,6 +144,7 @@ let context err warn =
 		constructs = Hashtbl.create 0;
 		delays = ref [];
 		flash9 = Plugin.defined "flash9";
+		doinline = not (Plugin.defined "no_inline");
 		in_constructor = false;
 		in_static = false;
 		in_loop = false;
@@ -2031,7 +2033,8 @@ and type_call ctx e el p =
 			ignore(follow f.cf_type); (* force evaluation *)
 			(match f.cf_expr with
 			| Some { eexpr = TFunction fd } ->
-				(match type_inline ctx fd ethis params tret p with
+				let i = if ctx.doinline then type_inline ctx fd ethis params tret p else None in
+				(match i with
 				| None -> mk (TCall (mk (TField (ethis,f.cf_name)) t p,params)) tret p
 				| Some e -> e)
 			| _ -> error "Recursive inline is not supported" p)
@@ -2718,6 +2721,7 @@ let type_module ctx m tdecls loadp =
 		ret = ctx.ret;
 		isproxy = ctx.isproxy;
 		flash9 = ctx.flash9;
+		doinline = ctx.doinline;
 		current = m;
 		locals = PMap.empty;
 		locals_map = PMap.empty;