Permalink
Browse files

[enhance] compiler, jsimp: Propagates only the original renaming to b…

…ackends
  • Loading branch information...
1 parent 112e8c9 commit 912531fd54a382e0949023b38ad2a2a84aae790c @BourgerieQuentin BourgerieQuentin committed Jul 24, 2012
View
3 compiler/opa/passes.ml
@@ -198,6 +198,7 @@ type 'tmp_env env_Gen = {
type env_Sliced_aux = QmlSimpleSlicer.splitted_code = {
code : QmlAst.code;
published : Pass_ExplicitInstantiation.published_map;
+ original_renaming : QmlRenamingMap.t;
renaming : QmlRenamingMap.t;
}
@@ -288,11 +289,13 @@ let pass_no_slicer ~options:(_:opa_options) (env:'tmp_env env_Gen) =
server = {
code;
published = IdentMap.empty;
+ original_renaming = QmlRenamingMap.empty;
renaming = QmlRenamingMap.empty;
};
client = {
code = [];
published = IdentMap.empty;
+ original_renaming = QmlRenamingMap.empty;
renaming = QmlRenamingMap.empty;
};
}
View
12 compiler/opa/s3Passes.ml
@@ -1476,12 +1476,12 @@ let pass_SlicedCleaning =
let client_renaming =
QmlRenamingMap.filter client_renaming filter_fun_renaming in
OpaMapToIdent.filter filter_fun;
- let server = {(* env_gen_sliced.P.server with *)
+ let server = { env_gen_sliced.P.server with
P.code = server_code;
P.published = server_published;
P.renaming = server_renaming;
} in
- let client = {(* env_gen_sliced.P.client with *)
+ let client = { env_gen_sliced.P.client with
P.code = client_code;
P.published = client_published;
P.renaming = client_renaming;
@@ -1541,9 +1541,11 @@ let pass_ExplicitInstantiation =
let annotmap = env.P.env_gen.P.typerEnv.QmlTypes.annotmap in
let {P.code=server_code;
published=server_published;
+ original_renaming=server_original_renaming;
renaming=server_renaming} = env.P.sliced_env.P.server in
let {P.code=client_code;
published=client_published;
+ original_renaming=client_original_renaming;
renaming=client_renaming} = env.P.sliced_env.P.client in
(* TODO: optimize by adding only dummy arguments for published functions,
if there is no explicit instantiation to be done there;
@@ -1601,10 +1603,12 @@ let pass_ExplicitInstantiation =
sliced_env =
{ P.server = { P.code = qmlAst_server;
published = server_published;
+ original_renaming=server_original_renaming;
renaming = server_renaming;
};
P.client = { P.code = qmlAst_client;
published = client_published;
+ original_renaming=client_original_renaming;
renaming = client_renaming;
}
};
@@ -1722,8 +1726,8 @@ let pass_SlicedToFinal =
{ P.
newFinalCompile_bsl = e.PH.env.P.env_gen.P.bsl ;
newFinalCompile_qml_milkshake = blender_milkshake;
- newFinalCompile_renaming_server = eenv.P.sliced_env.P.server.P.renaming;
- newFinalCompile_renaming_client = eenv.P.sliced_env.P.client.P.renaming;
+ newFinalCompile_renaming_server = eenv.P.sliced_env.P.server.P.original_renaming;
+ newFinalCompile_renaming_client = eenv.P.sliced_env.P.client.P.original_renaming;
newFinalCompile_closure_map = IdentMap.empty;
newFinalCompile_stdlib_gamma = e.PH.env.P.env_gen.P.stdlib_gamma;
} in
View
3 compiler/qmlslicer/qmlSimpleSlicer.ml
@@ -235,6 +235,7 @@ end
type splitted_code = {
code : QmlAst.code ;
published : Pass_ExplicitInstantiation.published_map;
+ original_renaming : QmlRenamingMap.t;
renaming : QmlRenamingMap.t ;
}
@@ -1579,11 +1580,13 @@ let split_code ~gamma:_ ~annotmap_old env code =
let client = {
code = List.rev (publish_rev_code_client @ rev_code_client);
published = client_published;
+ original_renaming = renaming_map_client;
renaming = renaming_map_client;
} in
let server = {
code = List.rev (publish_rev_code_server @ rev_code_server);
published = server_published;
+ original_renaming = renaming_map_server;
renaming = renaming_map_server;
} in
let res =
View
2 compiler/qmlslicer/qmlSimpleSlicer.mli
@@ -28,6 +28,8 @@ type splitted_code = {
contains its type of course)
*)
+ original_renaming : QmlRenamingMap.t ;
+
renaming : QmlRenamingMap.t ;
}

0 comments on commit 912531f

Please sign in to comment.