From f066675dc9ead0ef88e27c139c046906f2fcdaeb Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 8 Feb 2017 15:54:10 +0100 Subject: Checks can be applied add several places. There should not be a single check place, since for example unknonw attributes should be check after elaboration and other simplifications. --- cparser/Checks.ml | 9 +++------ cparser/Checks.mli | 2 +- cparser/Parse.ml | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cparser/Checks.ml b/cparser/Checks.ml index 434efea0..2e42cace 100644 --- a/cparser/Checks.ml +++ b/cparser/Checks.ml @@ -63,7 +63,7 @@ let rec unknown_attrs_stmt env s = | Sdecl d -> unknown_attrs_decl env s.sloc d let unknown_attrs_program p = - let rec transf_globdecls env = function + let rec unknown_attrs_globdecls env = function | [] -> () | g :: gl -> let env' = @@ -91,8 +91,5 @@ let unknown_attrs_program p = | Gpragma s -> env in - transf_globdecls env' gl - in transf_globdecls (Builtins.environment()) p - -let program p = - unknown_attrs_program p + unknown_attrs_globdecls env' gl + in unknown_attrs_globdecls (Builtins.environment()) p diff --git a/cparser/Checks.mli b/cparser/Checks.mli index 34185542..1566d6e4 100644 --- a/cparser/Checks.mli +++ b/cparser/Checks.mli @@ -13,4 +13,4 @@ (* *) (* *********************************************************************) -val program: C.program -> unit +val unknown_attrs_program: C.program -> unit diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 0d3003aa..f7676083 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -25,7 +25,7 @@ let transform_program t p name = (run_pass Bitfields.program 'f' p)))) in let p2 = Rename.program p1 in - Checks.program p2; + Checks.unknown_attrs_program p2; p2 let parse_transformations s = -- cgit