diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-08-21 13:23:30 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-08-21 13:23:30 +0000 |
commit | c46b574d5b21fb2728c76c5cab1c46890c0fb1cd (patch) | |
tree | 0ae850f934ef634eaa6cda9c294f0bdd055cb1c1 /cparser/Cprint.ml | |
parent | e499b023510259cc96be2093784b08cf090941d2 (diff) | |
download | compcert-c46b574d5b21fb2728c76c5cab1c46890c0fb1cd.tar.gz compcert-c46b574d5b21fb2728c76c5cab1c46890c0fb1cd.zip |
Support C99 compound literals (by expansion in Unblock pass).
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2615 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Cprint.ml')
-rw-r--r-- | cparser/Cprint.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cparser/Cprint.ml b/cparser/Cprint.ml index f26025e9..ee8002d4 100644 --- a/cparser/Cprint.ml +++ b/cparser/Cprint.ml @@ -191,7 +191,7 @@ let precedence = function (* H&S section 7.2 *) | EUnop((Odot _|Oarrow _), _) -> (16, LtoR) | EUnop((Opostincr|Opostdecr), _) -> (16, LtoR) | EUnop((Opreincr|Opredecr|Onot|Olognot|Ominus|Oplus|Oaddrof|Oderef), _) -> (15, RtoL) - | ECast _ -> (14, RtoL) + | ECast _ | ECompound _ -> (14, RtoL) | EBinop((Omul|Odiv|Omod), _, _, _) -> (13, LtoR) | EBinop((Oadd|Osub), _, _, _) -> (12, LtoR) | EBinop((Oshl|Oshr), _, _, _) -> (11, LtoR) @@ -310,6 +310,8 @@ let rec exp pp (prec, a) = fprintf pp "%a@ ? %a@ : %a" exp (4, a1) exp (4, a2) exp (4, a3) | ECast(ty, a1) -> fprintf pp "(%a) %a" typ ty exp (prec', a1) + | ECompound(ty, i) -> + fprintf pp "(%a) %a" typ ty init i | ECall({edesc = EVar {name = "__builtin_va_start"}}, [a1; {edesc = EUnop(Oaddrof, a2)}]) -> fprintf pp "__builtin_va_start@[<hov 1>(%a,@ %a)@]" @@ -330,7 +332,7 @@ let rec exp pp (prec, a) = end; if prec' < prec then fprintf pp ")@]" else fprintf pp "@]" -let rec init pp = function +and init pp = function | Init_single e -> exp pp (2, e) | Init_array il -> |