|
@@ -229,7 +229,7 @@ let inline_constructors ctx e =
|
|
begin match e.eexpr with
|
|
begin match e.eexpr with
|
|
| TConst _ -> loop (vs, decls, e::es) el
|
|
| TConst _ -> loop (vs, decls, e::es) el
|
|
| _ ->
|
|
| _ ->
|
|
- let v = alloc_var VInlined "arg" e.etype e.epos in
|
|
|
|
|
|
+ let v = alloc_var VGenerated "arg" e.etype e.epos in
|
|
let decle = mk (TVar(v, Some e)) ctx.t.tvoid e.epos in
|
|
let decle = mk (TVar(v, Some e)) ctx.t.tvoid e.epos in
|
|
let io_id_start = !current_io_id in
|
|
let io_id_start = !current_io_id in
|
|
ignore(analyze_aliases true decle);
|
|
ignore(analyze_aliases true decle);
|
|
@@ -241,7 +241,7 @@ let inline_constructors ctx e =
|
|
in
|
|
in
|
|
let argvs, argvdecls, pl = loop ([],[],[]) pl in
|
|
let argvs, argvdecls, pl = loop ([],[],[]) pl in
|
|
let _, cname = c.cl_path in
|
|
let _, cname = c.cl_path in
|
|
- let v = alloc_var VInlined ("inl"^cname) e.etype e.epos in
|
|
|
|
|
|
+ let v = alloc_var VGenerated ("inl"^cname) e.etype e.epos in
|
|
match Inline.type_inline_ctor ctx c cf tf (mk (TLocal v) (TInst (c,tl)) e.epos) pl e.epos with
|
|
match Inline.type_inline_ctor ctx c cf tf (mk (TLocal v) (TInst (c,tl)) e.epos) pl e.epos with
|
|
| Some inlined_expr ->
|
|
| Some inlined_expr ->
|
|
let has_untyped = (Meta.has Meta.HasUntyped cf.cf_meta) in
|
|
let has_untyped = (Meta.has Meta.HasUntyped cf.cf_meta) in
|
|
@@ -273,7 +273,7 @@ let inline_constructors ctx e =
|
|
| TNew({ cl_constructor = Some ({cf_kind = Method MethInline; cf_expr = Some _} as cf)} as c,_,pl),_ when is_extern_ctor c cf ->
|
|
| TNew({ cl_constructor = Some ({cf_kind = Method MethInline; cf_expr = Some _} as cf)} as c,_,pl),_ when is_extern_ctor c cf ->
|
|
error "Extern constructor could not be inlined" e.epos;
|
|
error "Extern constructor could not be inlined" e.epos;
|
|
| TObjectDecl fl, _ when captured && fl <> [] && List.for_all (fun((s,_,_),_) -> Lexer.is_valid_identifier s) fl ->
|
|
| TObjectDecl fl, _ when captured && fl <> [] && List.for_all (fun((s,_,_),_) -> Lexer.is_valid_identifier s) fl ->
|
|
- let v = alloc_var VInlined "inlobj" e.etype e.epos in
|
|
|
|
|
|
+ let v = alloc_var VGenerated "inlobj" e.etype e.epos in
|
|
let ev = mk (TLocal v) v.v_type e.epos in
|
|
let ev = mk (TLocal v) v.v_type e.epos in
|
|
let el = List.map (fun ((s,_,_),e) ->
|
|
let el = List.map (fun ((s,_,_),e) ->
|
|
let ef = mk (TField(ev,FDynamic s)) e.etype e.epos in
|
|
let ef = mk (TField(ev,FDynamic s)) e.etype e.epos in
|
|
@@ -290,7 +290,7 @@ let inline_constructors ctx e =
|
|
Some iv
|
|
Some iv
|
|
| TArrayDecl el, TInst(_, [elemtype]) when captured ->
|
|
| TArrayDecl el, TInst(_, [elemtype]) when captured ->
|
|
let len = List.length el in
|
|
let len = List.length el in
|
|
- let v = alloc_var VInlined "inlarr" e.etype e.epos in
|
|
|
|
|
|
+ let v = alloc_var VGenerated "inlarr" e.etype e.epos in
|
|
let ev = mk (TLocal v) v.v_type e.epos in
|
|
let ev = mk (TLocal v) v.v_type e.epos in
|
|
let el = List.mapi (fun i e ->
|
|
let el = List.mapi (fun i e ->
|
|
let ef = mk (TArray(ev,(mk (TConst(TInt (Int32.of_int i))) e.etype e.epos))) elemtype e.epos in
|
|
let ef = mk (TArray(ev,(mk (TConst(TInt (Int32.of_int i))) e.etype e.epos))) elemtype e.epos in
|
|
@@ -509,7 +509,7 @@ let inline_constructors ctx e =
|
|
let rec get_pretty_name iv = match iv.iv_kind with
|
|
let rec get_pretty_name iv = match iv.iv_kind with
|
|
| IVKField(io,fname,None) ->
|
|
| IVKField(io,fname,None) ->
|
|
begin try
|
|
begin try
|
|
- let is_user_variable iv = Meta.has Meta.UserVariable iv.iv_var.v_meta in
|
|
|
|
|
|
+ let is_user_variable iv = match iv.iv_var.v_kind with VUser _ | VInlined -> true | _ -> false in
|
|
let iv = List.find is_user_variable io.io_aliases in
|
|
let iv = List.find is_user_variable io.io_aliases in
|
|
(get_pretty_name iv) ^ "_" ^ fname;
|
|
(get_pretty_name iv) ^ "_" ^ fname;
|
|
with Not_found ->
|
|
with Not_found ->
|