Permalink
Browse files

[fix] compiler, database: Import database engine even if no user file…

…s. Credt:Bug reported by Owen Gunden <owen () phauna org
  • Loading branch information...
BourgerieQuentin committed Feb 27, 2012
1 parent 07aa7c6 commit 109fdf3c70f6b376d35115abf588127efa3af540
Showing with 6 additions and 13 deletions.
  1. +2 −3 opa/pass_DbEngineImportation.ml
  2. +2 −2 opa/pass_DbEngineImportation.mli
  3. +2 −8 opa/s3Passes.ml
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -22,7 +22,7 @@ module Db = QmlDbGen
let builtinpos = FilePos.nopos "Built in pass DbEngineImportation"
-let process_code ~stdlib code =
+let process_code ~stdlib =
if stdlib then (
let package = match QmlDbGen.Args.get_engine () with
| `db3 -> "stdlib.database.db3"
@@ -32,4 +32,3 @@ let process_code ~stdlib code =
ObjectFiles.add_compiler_package package;
)
;
- code
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -19,4 +19,4 @@
(**
This pass import the database runtime if needed.
*)
-val process_code : stdlib:bool -> ('ident, 'dir) SurfaceAst.code -> ('ident, 'dir) SurfaceAst.code
+val process_code : stdlib:bool -> unit
View
@@ -510,15 +510,9 @@ let pass_Print =
let pass_DbEngineImportation =
PassHandler.make_pass
(fun e ->
- let (a, user_files) = e.PH.env in
let stdlib = e.PH.options.O.stdlib in
- let user_files = List.map
- (fun pfile ->
- {pfile with SurfaceAstPassesTypes.parsedFile_lcode =
- Pass_DbEngineImportation.process_code ~stdlib
- pfile.SurfaceAstPassesTypes.parsedFile_lcode}
- ) user_files in
- { e with PH.env = (a, user_files) }
+ Pass_DbEngineImportation.process_code ~stdlib;
+ e
)

0 comments on commit 109fdf3

Please sign in to comment.