aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cabshelper.ml
diff options
context:
space:
mode:
authorJacques-Henri Jourdan <jacques-henri.jourdan@inria.fr>2015-11-01 22:32:23 +0100
committerJacques-Henri Jourdan <jacques-henri.jourdan@inria.fr>2015-11-01 22:32:23 +0100
commitb960c83725d7e185ac5c6e3c0d6043c7dcd2f556 (patch)
treee4567cd598d32114a440102397c41731f5a65412 /cparser/Cabshelper.ml
parente18d267e6912e18462472687abc014a3d04b9a37 (diff)
downloadcompcert-b960c83725d7e185ac5c6e3c0d6043c7dcd2f556.tar.gz
compcert-b960c83725d7e185ac5c6e3c0d6043c7dcd2f556.zip
Better handling of old-style K&R function declarations:
- Added a Cabs.PROTO_OLD constructor to Cabs.decl_type - Refactored the Parser.vy and pre_parser.mly grammars - Rewritten the conversion of old function definitions to new-style
Diffstat (limited to 'cparser/Cabshelper.ml')
-rw-r--r--cparser/Cabshelper.ml10
1 files changed, 1 insertions, 9 deletions
diff --git a/cparser/Cabshelper.ml b/cparser/Cabshelper.ml
index 5e6a19d0..b3782ba8 100644
--- a/cparser/Cabshelper.ml
+++ b/cparser/Cabshelper.ml
@@ -46,8 +46,7 @@ let rec isTypedef = function
let get_definitionloc (d : definition) : cabsloc =
match d with
- | FUNDEF(_, _, _, l) -> l
- | KRFUNDEF(_, _, _, _, _, l) -> l
+ | FUNDEF(_, _, _, _, l) -> l
| DECDEF(_, l) -> l
| PRAGMA(_, l) -> l
@@ -78,10 +77,3 @@ let string_of_cabsloc l =
let format_cabsloc pp l =
Format.fprintf pp "%s:%d" l.filename l.lineno
-
-let rec append_decltype dt1 dt2 =
- match dt1 with
- | JUSTBASE -> dt2
- | ARRAY(dt, attr, sz) -> ARRAY(append_decltype dt dt2, attr, sz)
- | PTR(attr, dt) -> PTR(attr, append_decltype dt dt2)
- | PROTO(dt, params) -> PROTO(append_decltype dt dt2, params)