Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #12 from vrotaru/master

Update for llvm 3.1 (ocaml 4.0)
  • Loading branch information...
commit c6bab4c40d0636faef0154f4c8b3d40dd1b29a3a 2 parents 46551c5 + 28846b9
@pikatchu authored
View
13 compiler/emit.ml
@@ -99,9 +99,8 @@ module Type = struct
and opaques md_id md ctx t = function
| Dtype (x, _) ->
- let ty = opaque_type ctx in
let name = public_name md_id x in
- assert (define_type_name name ty md) ;
+ let ty = named_struct_type ctx name in
IMap.add x ty t
| _ -> t
@@ -127,8 +126,14 @@ module Type = struct
and refine t t' = function
| Dtype (x, _) ->
- let ty = IMap.find x t' in
- refine_type (IMap.find x t) ty
+ let ty = IMap.find x t in
+ let ty' = IMap.find x t' in
+ let element_types =
+ if classify_type ty' = TypeKind.Struct
+ then struct_element_types ty'
+ else [| ty' |]
+ in
+ struct_set_body ty element_types false
| _ -> ()
and function_ is_lib md_name mds t md ctx lkinds df =
View
4 compiler/main.ml
@@ -203,11 +203,11 @@ let _ =
let bc = Emit.program base !root !no_opt !dump_as llst in
let bc = opt "-internalize" bc in
let bc = opt "-mem2reg" bc in
- let bc = opt "-tailduplicate" bc in
+ (*let bc = opt "-tailduplicate" bc in*)
let bc = opt "-inline" bc in
let bc = opt "-always-inline" bc in
let bc = opt "-break-crit-edges" bc in
- let bc = opt "-live-values" bc in
+ (*let bc = opt "-live-values" bc in*)
let bc = opt "-lda" bc in
let bc = opt "-ipsccp" bc in
let bc = opt "-ipconstprop" bc in
View
1  compiler/stastOfTast.ml
@@ -71,6 +71,7 @@ let check_binop op ((p, _) as ty) =
| Ast.Eminus, (Stast.Tint | Stast.Tfloat) -> ()
| Ast.Estar, (Stast.Tint | Stast.Tfloat) -> ()
| Ast.Ediv, (Stast.Tint | Stast.Tfloat) -> ()
+ | Ast.Emod, (Stast.Tint) -> ()
| Ast.Eor, (Stast.Tbool) -> ()
| Ast.Eand, (Stast.Tbool) -> ()
| _ -> Error.expected_numeric p
View
18 configure
@@ -322,7 +322,7 @@ fi
echo ""
llc_version=`$llc -version | grep version` ;
-if [[ "$llc_version" =~ .*version.2.[8|9].* ]]; then
+if [[ "$llc_version" =~ .*version.3.[0|1].* ]]; then
echo -e "Checking llc \t: OK$llc_version"
else
echo "Bad version of llc (expected version 2.8): $version" 2>&1;
@@ -330,15 +330,15 @@ else
fi
opt_version=`$opt -version | grep version` ;
-if [[ "$opt_version" =~ .*version.2.[8|9].* ]]; then
+if [[ "$opt_version" =~ .*version.3.[0|1].* ]]; then
echo -e "Checking opt \t: OK$opt_version"
else
- echo "Bad version of opt (expected version 2.8): $version" 2>&1;
+ echo "Bad version of opt (expected version 3.0): $version" 2>&1;
exit 2
fi
ocamlc_version=`$ocamlc -version` ;
-if [[ "$ocamlc_version" =~ 3.1[^0].* ]]; then
+if [[ "$ocamlc_version" =~ 4.00.* ]]; then
echo -e "Checking ocamlc \t: OK $ocamlc_version"
else
echo "Bad version of ocamlc (< 3.11): $version" 2>&1;
@@ -346,7 +346,7 @@ else
fi
ocamlopt_version=`$ocamlopt -version` ;
-if [[ "$ocamlopt_version" =~ 3.1[^0].* ]]; then
+if [[ "$ocamlopt_version" =~ 4.00.* ]]; then
echo -e "Checking ocamlopt\t: OK $ocamlopt_version"
else
echo "Bad version of ocamlopt (< 3.11): $version" 2>&1;
@@ -354,15 +354,15 @@ else
fi
ocamllex_version=`$ocamllex -version` ;
-if [[ "$ocamllex_version" =~ 3.1[^0].* ]]; then
+if [[ "$ocamllex_version" =~ 4.00.* ]]; then
echo -e "Checking ocamllex\t: OK $ocamllex_version"
else
- echo "Bad version of ocamllex (< 3.11): $version" 2>&1;
+ echo "Bad version of ocamllex (< 4.00): $version" 2>&1;
exit 2
fi
ocamlyacc_version=`$ocamlyacc -version` ;
-if [[ "$ocamlyacc_version" =~ 3.1[^0].* ]]; then
+if [[ "$ocamlyacc_version" =~ 4.00.* ]]; then
echo -e "Checking ocamlyacc\t: OK $ocamlyacc_version"
else
echo "Bad version of ocamlyacc (< 3.11): $version" 2>&1;
@@ -370,7 +370,7 @@ else
fi
ocamldep_version=`$ocamldep -version` ;
-if [[ "$ocamldep_version" =~ 3.1[^0].* ]]; then
+if [[ "$ocamldep_version" =~ 4.00.* ]]; then
echo -e "Checking ocamldep\t: OK $ocamldep_version"
else
echo "Bad version of ocamldep (< 3.11): $version" 2>&1;

0 comments on commit c6bab4c

Please sign in to comment.
Something went wrong with that request. Please try again.