Commit Graph

108 Commits (master)

Author SHA1 Message Date
Fabrice Le Fessant 8daa184d95 New -depend option for ocamlc/ocamlopt 2017-06-01 15:56:30 +02:00
sliquister 356d8a9c0c Changing the display of fatal warnings (#948) 2017-03-08 09:16:01 +00:00
Fabrice Le Fessant b7b0a64d33 ocamldep: add -plugin and use compilerlibs to build (#1015)
* ocamldep: add -plugin argument, and use compilerlibs to build
2017-03-02 16:45:58 +01:00
octachron f59fb0e640 -shared option for ocamldep 2017-02-17 11:54:06 +01:00
aalekseyev cf19debb3e Make "-open" command line flag accept a module path (#960)
* Make "-open" command line flag accept a module path
2016-12-09 08:27:06 -05:00
Bernhard Schommer 62335624a9
Added simple parse_expand and support ocamldep
The parse_expand function does the same as parse and parse_dynamic
but allows Expand. However it does not update current to avoid
the problem that the array is modified.

This function is used for the ocamlopt, ocamlc, ocamlcp,
ocamloptp and ocamldep.
2016-10-12 09:30:54 +02:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Fabrice Le Fessant f26c0ff8b6 Add plugins in the compiler 2016-07-18 17:43:05 +02:00
Gabriel Scherer 5f1bc3ef6f Make Pparse functions type-safe
In order to remove some redundancy, the Pparse modules used a dirty
Obj.magic trick to manipulate either structure or signature values
(ASTs parsed from source files). This unsafe approach means that
programming mistakes may result in broken type soudness, and indeed
I myself had to track a very puzzling Segfault during the development
of my Menhir backend (due to a copy-paste error I was passing
Parse.implementation instead of Parse.interface somewhere). Wondering
why your parser generator seems to generate segfaulting parsers is
Not Fun.

This change means that the external interface of Pparse has changed
a bit. There is no way to fulfill the type of Pparse.file in
a type-safe way

    val file : formatter -> tool_name:string -> string ->
      (Lexing.lexbuf -> 'a) -> string -> 'a

as it promises to be able to process any ast type 'a depending on the
magic number (the last string argument). The knew type-safe interface is

    val file : formatter -> tool_name:string -> string ->
      (Lexing.lexbuf -> 'a) -> 'a ast_kind -> 'a

where ['a ast_kind] is a GADT type:

    type 'a ast_kind =
    | Structure : Parsetree.structure ast_kind
    | Signature : Parsetree.signature ast_kind
2016-06-29 21:23:28 -04:00
Gabriel Scherer cc69cbf31c MPR#7248: have ocamldep interpret -open arguments in left-to-right order
Compilers and tools consistently assume that (_ list ref) in Cflags
are prepended to, and reverse them before usage. This one was
forgotten.
2016-05-06 12:05:16 -04:00
alainfrisch c4e8117c2b Cleanup. 2016-03-10 15:34:48 +01:00
alainfrisch 3730cab2d1 Sort the list of input files alphabetically. 2016-03-10 15:33:36 +01:00
alainfrisch 1ef3f35c02 Print dependencies at the end.
This introduces a tiny change of behavior since command line options which affect the
printing of dependencies (-modules, -all, -ml-synonym, -mlfi-synonym) are taken into
account even for files mentioned before on the command-line.  This is probably not going to break
anything.

Note: this commit also reverse the ordering of the output, but we will normalize it in the next
commit anyway.
2016-03-10 15:33:35 +01:00
alainfrisch 2261e4413d Single entry point to print deps. 2016-03-10 15:33:34 +01:00
alainfrisch 4aea2c1903 Move dependency printing code to their own function. 2016-03-10 15:33:33 +01:00
alainfrisch a00a193e35 Cleanup. 2016-03-10 15:33:32 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Pierre Chambart 2555c4e773 Update main and ocamldep 2016-01-25 18:50:29 +01:00
Jeremie Dimino b95a642bdc PR#6795, PR#6996: make ocamldep interpret [%ocaml.error] 2015-12-17 10:42:47 +00:00
Jeremie Dimino f3ba667fcb fix typo in ocamldep 2015-12-01 10:54:15 +00:00
Jacques Garrigue 381328e92e add module alias support to ocamldep 2015-12-01 00:07:36 +09:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Gabriel Scherer 02abd6c244 ocamldep: make printing of cyclic dependencies deterministic
Hashtbl.iter used to be deterministic, but it's now an observable
source of randomness.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16351 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:57 +00:00
Gabriel Scherer 4530ee379c GPR#118 ocamldep -allow-approx: fallback to a lexer-based approximation
(Frédéric Bour)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16009 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-12 17:43:04 +00:00
Damien Doligez c51df1aecf relax ocamldep test to allow for non-ASCII module identifiers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15915 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-12 17:55:28 +00:00
Gabriel Scherer f15f4f3ed8 PR6695: Make sure the compiler only uses ASCII string functions.
This should cover all places involving filenames in the compiler.
There are a few more paths still using Latin-1 in other ways,
e.g. in ocamldoc.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15727 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:14 +00:00
Gabriel Scherer 97cff22e45 ocamldep support for -open
Adding an `open_module` function to the Depend interface instead of
directly mutating `free_structure_names` makes the approach robust to
eventual improvement to ocamldep's handling of `open` (for example, in
presence of .cmi for the opened units it could add their submodules
to the set of bound vars). This only goes so far, however, as the
overall imperative style would not nicely support proper local
handling of `let open M in e`.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15468 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 20:31:34 +00:00
Gabriel Scherer dfcccc7999 minor refactoring in ocamldep.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15467 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 20:31:32 +00:00
Alain Frisch 047e09748c Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:46:34 +00:00
Alain Frisch 68ae2cc74b Enable warning 27 in tools/ and fix occurrences. It's good to mark in depend and untypeast parts which are explicitly ignored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14794 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 10:41:21 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Alain Frisch d18a044380 Keep input file in Pparse.Error. Switch it to the new system.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14108 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 12:27:33 +00:00
Alain Frisch 71efb4666b Switch Lexer.Error to the new system.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14107 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 11:59:45 +00:00
Alain Frisch 6ad98b3d09 Port Syntaxerr.Error to the new system. Trickier, because of special way to report some errors in the toplevel (is it really worth the trouble?).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-11 18:10:59 +00:00
Damien Doligez 7844495624 Merge branch 4.01 from branching point to 4.01.0+rc1
Command line used:
  svn merge --accept postpone -r 13776:14055 $REPO/version/4.01 .


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14060 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-04 15:12:37 +00:00
Fabrice Le Fessant 1823936ce0 Fix OCAMLPARAM problems
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13901 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-17 12:35:26 +00:00
Fabrice Le Fessant ad6c285818 Improved implementation of OCAMLPARAM
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-05 16:34:40 +00:00
Damien Doligez 7b31f54095 It is no longer necessary to keep pre-processed files in case of errors
(see commits 3817 and 5224,5302,5816)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13406 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-18 20:13:53 +00:00
Gabriel Scherer bca20db060 fix PR#5930: ocamldep leaks temporary preprocessing files
Ah, if we had let-try...


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13309 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-02-24 09:11:29 +00:00
Alain Frisch ef9fc7ab0f #5904: support for -ppx in the toplevel.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13278 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-25 09:12:31 +00:00
Wojciech Meyer 7efba284ce Reverting "PR#5868: Bytecode dependencies should not appear in output of ocamldep"
-native flag semantics are currently different to that what the user
expects, and what was attempted to be fixed. The semantics of -native
are not to completely disable generation of dependencies for bytecode
instead make the compilation to native code more efficient.

Most of the project are expected to be buildable with both versions of
the compiler. So ocamldep is expected to always generate the
dependencies in both cases. When the .mli file is absent ocamldep
needs to still generate dependencies in bytecode to build the cmi only
and to build cmi and cmx for the dependent compilation unit . Because
of some make tool pecularities, handling of two different rules that
include the same depenency is problematic, so instead when the -native
flag is not used the cmo file is used as a proxy to build cmi, when
the -native enabled however, the cmx file is used as proxy to build
cmi file for the dependencies to avoid recompilation of the dependent
.cmo file just to get .cmi file.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13202 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-03 17:38:21 +00:00
Wojciech Meyer f97f2f5bab PR#5868: Somewhat a better fix for -native option.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-01 16:17:58 +00:00
Wojciech Meyer 04bca674d3 PR#5868: Bytecode dependencies should not appear in output of ocamldep when -native flag is used
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-01 15:09:08 +00:00
Alain Frisch a19a4642e5 Enable 'unused stuff' warnings in tools/ and get rid of them.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13140 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-19 09:25:21 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 89077f5f46 Make ocamldep ignore toplevel directives in .ml files, as it did before
commit 12769.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12854 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-10 07:19:12 +00:00
Damien Doligez 8cf9581e20 remove leftover debug code from previous commit
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12853 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-09 22:27:53 +00:00
Damien Doligez 187e5f1a44 undo commit 12847, it breaks preprocessing
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12852 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-09 22:21:29 +00:00
Damien Doligez f605646709 Revert one change of commit 12769 that (inadvertently?) breaks ocamlnet 3.5.1
by triggering a syntax error on toplevel directives inside .ml files.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12847 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-09 19:40:10 +00:00
Alain Frisch 412ee0f3e0 Support -absname in ocamldep + update man pages.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12819 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-03 10:22:35 +00:00