~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to bytecomp/translcore.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
(*                                                                     *)
11
11
(***********************************************************************)
12
12
 
13
 
(* $Id: translcore.ml 8992 2008-08-27 10:23:21Z garrigue $ *)
 
13
(* $Id: translcore.ml 10445 2010-05-20 14:57:42Z doligez $ *)
14
14
 
15
15
(* Translation from typed abstract syntax to lambda terms,
16
16
   for the core language *)
381
381
        let idlist' = add_letrec bindings idlist in
382
382
        List.for_all (fun (id, arg) -> check idlist' arg) bindings &&
383
383
        check_top idlist' body
 
384
    | Lprim (Pmakearray (Pgenarray), args) -> false
384
385
    | Lsequence (lam1, lam2) -> check idlist lam1 && check_top idlist lam2
385
386
    | Levent (lam, _) -> check_top idlist lam
386
387
    | lam -> check idlist lam
398
399
        check idlist' body
399
400
    | Lprim(Pmakeblock(tag, mut), args) ->
400
401
        List.for_all (check idlist) args
401
 
    | Lprim(Pmakearray(Paddrarray|Pintarray), args) ->
 
402
    | Lprim(Pmakearray(_), args) ->
402
403
        List.for_all (check idlist) args
403
 
    | Lprim (Pmakearray (Pgenarray), args) -> false
404
404
    | Lsequence (lam1, lam2) -> check idlist lam1 && check idlist lam2
405
405
    | Levent (lam, _) -> check idlist lam
406
406
    | lam ->
762
762
             (Lvar cpy))
763
763
  | Texp_letmodule(id, modl, body) ->
764
764
      Llet(Strict, id, !transl_module Tcoerce_none None modl, transl_exp body)
 
765
  | Texp_pack modl ->
 
766
      !transl_module Tcoerce_none None modl
765
767
  | Texp_assert (cond) ->
766
768
      if !Clflags.noassert
767
769
      then lambda_unit
790
792
              Lprim(Pmakeblock(Obj.forward_tag, Immutable), [transl_exp e])
791
793
          (* the following cannot be represented as float/forward/lazy:
792
794
             optimize *)
793
 
          | Tarrow(_,_,_,_) | Ttuple _ | Tobject(_,_) | Tnil | Tvariant _
 
795
          | Tarrow(_,_,_,_) | Ttuple _ | Tpackage _ | Tobject(_,_) | Tnil | Tvariant _
794
796
              -> transl_exp e
795
797
          (* optimize predefined types (excepted float) *)
796
798
          | Tconstr(_,_,_) ->