Permalink
Browse files

Updating for llvm 3.1 and Ocaml 4.0

Part of the update is trivial, just changing the version numbers in configure script.

Adapting to the type handling change in llv3 3.0 was a bit more involved, mostly because I needed to figure out what is happennig. But the change is rather simple 
and straigthforward.

The obsoleted command options for llvm opt are just commented out, because I'm
not sure what their equivalents are.
  • Loading branch information...
1 parent 46551c5 commit 82e2b8e54f4254db9bc03474bd3ccdb82501849f @vrotaru vrotaru committed Sep 23, 2012
Showing with 20 additions and 15 deletions.
  1. +9 −4 compiler/emit.ml
  2. +2 −2 compiler/main.ml
  3. +9 −9 configure
View
@@ -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
@@ -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
@@ -322,55 +322,55 @@ 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;
exit 2
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;
exit 2
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;
exit 2
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;
exit 2
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 82e2b8e

Please sign in to comment.