diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2014-01-10 07:53:33 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2014-01-10 07:53:33 +0000 |
commit | 3b4d7cf63b889b86c33efcbbe79f9937b663b9f6 (patch) | |
tree | befe14b04b00480f16f1b79de58f38eba00936f4 /bytecomp/lambda.ml | |
parent | 4a25508fc253019e936460396328b22554f83050 (diff) | |
parent | d90b126bd428999d767ef4db4c5d3b05eb27c345 (diff) |
Merge module-alias branch (cf. PR#6063)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14394 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/lambda.ml')
-rw-r--r-- | bytecomp/lambda.ml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bytecomp/lambda.ml b/bytecomp/lambda.ml index b64dee2ac..aa56c31fa 100644 --- a/bytecomp/lambda.ml +++ b/bytecomp/lambda.ml @@ -258,10 +258,10 @@ and sameswitch sw1 sw2 = | (Some a1, Some a2) -> same a1 a2 | _ -> false) -let name_lambda arg fn = +let name_lambda strict arg fn = match arg with Lvar id -> fn id - | _ -> let id = Ident.create "let" in Llet(Strict, id, arg, fn id) + | _ -> let id = Ident.create "let" in Llet(strict, id, arg, fn id) let name_lambda_list args fn = let rec name_list names = function @@ -383,14 +383,19 @@ let rec patch_guarded patch = function (* Translate an access path *) -let rec transl_path = function +let rec transl_normal_path = function Pident id -> if Ident.global id then Lprim(Pgetglobal id, []) else Lvar id | Pdot(p, s, pos) -> - Lprim(Pfield pos, [transl_path p]) + Lprim(Pfield pos, [transl_normal_path p]) | Papply(p1, p2) -> fatal_error "Lambda.transl_path" +(* Translation of value identifiers *) + +let transl_path ?(loc=Location.none) env path = + transl_normal_path (Env.normalize_path (Some loc) env path) + (* Compile a sequence of expressions *) let rec make_sequence fn = function |