diff options
author | Alain Frisch <alain@frisch.fr> | 2011-12-29 17:49:58 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2011-12-29 17:49:58 +0000 |
commit | 83d48700ffcf6cb9f4fcc3ef7664174859a0a7fd (patch) | |
tree | dac62c8f87f61a611edb384e4bdb7f151a279493 /driver | |
parent | 12d6154526644fa241cfe30994b049b1e187b861 (diff) |
Replace existing warnings 26, 27, trying to preserve their semantics.
- Warning 26 detects unused variables bound by 'let' or 'as'. In case of a or-pattern,
a variable is considered to be an "as" variable or not according to the lhs pattern only.
- Warning 27 detects unused variables bound by 'match', 'fun', 'function', and self-variable
in objects.
- When several values are bound by a given let pattern: if all of them are unused,
warning 26 is trigerred; if at least one of them is used, the other unused ones
are reported with warning 27.
This commit also introduces dedicated warnings for unused ancestor variables (objects) and
for-loop indices.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/unused_declarations@11976 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver')
-rw-r--r-- | driver/compile.ml | 1 | ||||
-rw-r--r-- | driver/optcompile.ml | 2 |
2 files changed, 0 insertions, 3 deletions
diff --git a/driver/compile.ml b/driver/compile.ml index 33a198ed8..a27ffaa19 100644 --- a/driver/compile.ml +++ b/driver/compile.ml @@ -126,7 +126,6 @@ let implementation ppf sourcefile outputprefix = try Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation - ++ Unused_var.warn ppf ++ Typemod.type_implementation sourcefile outputprefix modulename env ++ Translmod.transl_implementation modulename ++ print_if ppf Clflags.dump_rawlambda Printlambda.lambda diff --git a/driver/optcompile.ml b/driver/optcompile.ml index ada7d9f71..1e6ab0ce3 100644 --- a/driver/optcompile.ml +++ b/driver/optcompile.ml @@ -119,12 +119,10 @@ let implementation ppf sourcefile outputprefix = if !Clflags.print_types then ignore( Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation - ++ Unused_var.warn ppf ++ Typemod.type_implementation sourcefile outputprefix modulename env) else begin Pparse.file ppf inputfile Parse.implementation ast_impl_magic_number ++ print_if ppf Clflags.dump_parsetree Printast.implementation - ++ Unused_var.warn ppf ++ Typemod.type_implementation sourcefile outputprefix modulename env ++ Translmod.transl_store_implementation modulename +++ print_if ppf Clflags.dump_rawlambda Printlambda.lambda |