Browse Source

[cpp] Fixed issue #1665 ; Temporarily disabled DCE to find issues obscured by it

Caue Waneck 12 years ago
parent
commit
082c16bbef
2 changed files with 5 additions and 1 deletions
  1. 3 0
      gencpp.ml
  2. 2 1
      tests/unit/compile.hxml

+ 3 - 0
gencpp.ml

@@ -2709,6 +2709,7 @@ let access_str a = match a with
 let generate_class_files common_ctx member_types super_deps constructor_deps class_def file_info scriptable =
 let generate_class_files common_ctx member_types super_deps constructor_deps class_def file_info scriptable =
 	let class_path = class_def.cl_path in
 	let class_path = class_def.cl_path in
 	let class_name = (snd class_def.cl_path) ^ "_obj" in
 	let class_name = (snd class_def.cl_path) ^ "_obj" in
+	let is_abstract_impl = match class_def.cl_kind with | KAbstractImpl _ -> true | _ -> false in
 	let smart_class_name =  (snd class_def.cl_path)  in
 	let smart_class_name =  (snd class_def.cl_path)  in
 	(*let cpp_file = new_cpp_file common_ctx.file class_path in*)
 	(*let cpp_file = new_cpp_file common_ctx.file class_path in*)
 	let cpp_file = new_placed_cpp_file common_ctx class_path in
 	let cpp_file = new_placed_cpp_file common_ctx class_path in
@@ -2903,9 +2904,11 @@ let generate_class_files common_ctx member_types super_deps constructor_deps cla
 		in
 		in
       let is_readable field =
       let is_readable field =
 			(match field.cf_kind with | Var { v_read = AccNever } | Var { v_read = AccInline } -> false
 			(match field.cf_kind with | Var { v_read = AccNever } | Var { v_read = AccInline } -> false
+			| Var _ when is_abstract_impl -> false
 			| _ -> true) in
 			| _ -> true) in
       let is_writable field =
       let is_writable field =
 			(match field.cf_kind with | Var { v_write = AccNever } | Var { v_read = AccInline } -> false
 			(match field.cf_kind with | Var { v_write = AccNever } | Var { v_read = AccInline } -> false
+			| Var _ when is_abstract_impl -> false
 			| _ -> true) in
 			| _ -> true) in
 
 
       let reflective field = not (Meta.has Meta.Unreflective field.cf_meta) in
       let reflective field = not (Meta.has Meta.Unreflective field.cf_meta) in

+ 2 - 1
tests/unit/compile.hxml

@@ -21,7 +21,8 @@
 -resource res1.txt
 -resource res1.txt
 -resource res2.bin
 -resource res2.bin
 --no-opt
 --no-opt
--dce full
+#DCE temporarily disabled so we can fix all DCE-obscured issues
+#-dce full
 --each
 --each
 
 
 #flash8
 #flash8