Skip to content
Browse files

[fix] compiler: Update exported idents (pass ResolveRemoteCalls)

  • Loading branch information...
1 parent da8f83b commit 95460d7dd6aee8e04bdbb0721d1a8022e2bac3d2 @BourgerieQuentin BourgerieQuentin committed Sep 24, 2012
Showing with 23 additions and 19 deletions.
  1. +16 −15 compiler/opa/opa_InsertRemote.ml
  2. +2 −2 compiler/opa/opa_InsertRemote.mli
  3. +5 −2 compiler/opa/passes.ml
View
31 compiler/opa/opa_InsertRemote.ml
@@ -1179,7 +1179,7 @@ let generate_stub_from_publish,
(fun k x -> Hashtbl.add prev_stubs k x),
(fun folder ->
Hashtbl.fold
- (fun ident (sident, _, _) acc -> folder ident sident acc)
+ (fun ident (sident, _, expanded) acc -> folder expanded ident sident acc)
current_stubs
),
(fun _ -> current_stubs)
@@ -1359,32 +1359,33 @@ let prelude ~gamma ~annotmap code1 code2 =
with e when String.is_prefix "stdlib." (ObjectFiles.get_current_package_name ())
-> error_stdlib gamma annotmap code1 code2 e
-let postlude orig_renaming1 orig_renaming2 =
+let postlude orig_renaming1 orig_renaming2 exported =
(* Finalize pass *)
(* Update renaming map *)
- let renaming1,renaming2 =
+ let renaming1,renaming2,exported =
fold_current_stubs
- (fun org stu (renaming1,renaming2) ->
+ (fun expanded org stu (renaming1,renaming2,exported) ->
match QmlRenamingMap.original_from_new_opt orig_renaming2 org with
| None ->
(match QmlRenamingMap.original_from_new_opt orig_renaming1 org with
| None ->
- OManager.printf "error when updating renaming map on %a" QmlPrint.pp#ident org
- (*
- Mathieu Wed Mar 9 11:53:45 CET 2011
- FIXME: This is a wild warning
- *)
- ;
- QmlRenamingMap.add renaming1 org stu, QmlRenamingMap.add renaming2 org stu (* no idea what to do *)
+ OManager.i_error "error when updating renaming map on %a" QmlPrint.pp#ident org
| Some org ->
- renaming1, QmlRenamingMap.add renaming2 org stu)
+ (renaming1, QmlRenamingMap.add renaming2 org stu,
+ if expanded && IdentSet.mem org exported then
+ IdentSet.add stu exported
+ else exported)
+ )
| Some org ->
assert (Option.is_none (QmlRenamingMap.original_from_new_opt orig_renaming1 org));
- QmlRenamingMap.add renaming1 org stu, renaming2
- ) (orig_renaming1,orig_renaming2) in
+ QmlRenamingMap.add renaming1 org stu, renaming2,
+ (if expanded && IdentSet.mem org exported then
+ IdentSet.add stu exported
+ else exported)
+ ) (orig_renaming1,orig_renaming2,exported) in
(* Save object files *)
R.save (get_current_stubs ());
- renaming1, renaming2
+ renaming1, renaming2, exported
(** Perform on an AST (code).
@param expmap1 Explicit map of the computed side
View
4 compiler/opa/opa_InsertRemote.mli
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -208,7 +208,7 @@ type options = {
val default_options : options
val prelude : gamma:QmlTypes.gamma -> annotmap:QmlAst.annotmap -> QmlAst.code -> QmlAst.code -> unit
-val postlude : QmlRenamingMap.t -> QmlRenamingMap.t -> QmlRenamingMap.t * QmlRenamingMap.t
+val postlude : QmlRenamingMap.t -> QmlRenamingMap.t -> IdentSet.t -> QmlRenamingMap.t * QmlRenamingMap.t * IdentSet.t
val need_to_process_code : QmlAst.code -> QmlAst.code -> bool
(** Work on server code. Resolve :
View
7 compiler/opa/passes.ml
@@ -768,8 +768,10 @@ let pass_resolve_remote_calls ~options (env:'tmp_env env_Gen_sliced) =
let server_code = more_server_code @ server_code in
let client_code = more_client_code @ client_code in
- let client_renaming, server_renaming =
- Opa_InsertRemote.postlude client_renaming server_renaming in
+ let exported = env.env_gen.exported in
+
+ let client_renaming, server_renaming, exported =
+ Opa_InsertRemote.postlude client_renaming server_renaming exported in
let sliced_env =
{
@@ -786,6 +788,7 @@ let pass_resolve_remote_calls ~options (env:'tmp_env env_Gen_sliced) =
} in
let env_gen =
{ env.env_gen with
+ exported;
qmlAst = [];
typerEnv = { env.env_gen.typerEnv with
QmlTypes.annotmap = annotmap;

0 comments on commit 95460d7

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