1
(**************************************************************************)
3
(* Copyright (C) 2001-2003, *)
4
(* George C. Necula <necula@cs.berkeley.edu> *)
5
(* Scott McPeak <smcpeak@cs.berkeley.edu> *)
6
(* Wes Weimer <weimer@cs.berkeley.edu> *)
7
(* Ben Liblit <liblit@cs.berkeley.edu> *)
8
(* All rights reserved. *)
10
(* Redistribution and use in source and binary forms, with or without *)
11
(* modification, are permitted provided that the following conditions *)
14
(* 1. Redistributions of source code must retain the above copyright *)
15
(* notice, this list of conditions and the following disclaimer. *)
17
(* 2. Redistributions in binary form must reproduce the above copyright *)
18
(* notice, this list of conditions and the following disclaimer in the *)
19
(* documentation and/or other materials provided with the distribution. *)
21
(* 3. The names of the contributors may not be used to endorse or *)
22
(* promote products derived from this software without specific prior *)
23
(* written permission. *)
25
(* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *)
26
(* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *)
27
(* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *)
28
(* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *)
29
(* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *)
30
(* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *)
31
(* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *)
32
(* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *)
33
(* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *)
34
(* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *)
35
(* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *)
36
(* POSSIBILITY OF SUCH DAMAGE. *)
38
(* File modified by CEA (Commissariat � l'�nergie Atomique). *)
39
(**************************************************************************)
41
val convFile: Cabs.file -> Cil_types.file
43
(** NDC added command line parameter.
44
Turn on tranformation that forces correct parameter evaluation order *)
45
val forceRLArgEval: bool ref
47
(** Set this integer to the index of the global to be left in CABS form. Use
51
(** Indicates whether we're allowed to duplicate small chunks of code. *)
52
val allowDuplication: bool ref
54
(** A hook into the code that creates temporary local vars. By default this
55
is the identity function, but you can overwrite it if you need to change the
56
types of cabs2cil-introduced temp variables. *)
57
val typeForInsertedVar: (Cil_types.typ -> Cil_types.typ) ref
59
(** Like [typeForInsertedVar], but for casts.
60
[typeForInsertedCast expr original_type destination_type]
61
returns the type into which [expr], which has type [original_type] and
62
whose type must be converted into [destination_type], must be casted.
64
By default, returns [destination_type].
66
This applies only to implicit casts. Casts already present
67
in the source code are exempt from this hook. *)
68
val typeForInsertedCast:
69
(Cil_types.exp -> Cil_types.typ -> Cil_types.typ -> Cil_types.typ) ref
71
(** [fresh_global prefix] creates a variable name not clashing with any other
72
globals and starting with [prefix] *)
73
val fresh_global : string -> string
75
(** CEA-LRI: exports for logic typing *)
77
(** Check that [s] starts with the prefix [p]. *)
78
val prefix : string -> string -> bool
80
val annonCompFieldName : string
81
val conditionalConversion : Cil_types.typ -> Cil_types.typ -> Cil_types.typ
82
val arithmeticConversion : Cil_types.typ -> Cil_types.typ -> Cil_types.typ
83
val integralPromotion : Cil_types.typ -> Cil_types.typ
85
val blockInitializer :
87
Cil_types.varinfo -> Cabs.init_expression ->
88
Cil_types.block * Cil_types.init * Cil_types.typ
90
(** Returns a block of statements equivalent to the initialization [init]
91
applied to lvalue [lval] of type [typ]. *)
93
Cil_types.lval -> Cil_types.init -> Cil_types.typ -> Cil_types.block
95
(** Applies [mkAddrOf] after marking variable whose address is taken. *)
96
val mkAddrOfAndMark : Cil_types.lval -> Cil_types.exp
98
(** If called, sets a flag so that [continue] in while loops get transformed
99
into forward gotos, like it is already done in do-while and for loops. *)
100
val setDoTransformWhile : unit -> unit
102
(** If called, sets a flag so that translation of conditionals does not result
103
in forward ingoing gotos (from the if-branch to the else-branch). *)
104
val setDoAlternateConditional : unit -> unit
106
(** If called, sets a flag so that translation of assignments as
107
sub-expressions returns the right-hand-side rather than
108
the left-hand-side. *)
109
val setDoAlternateAssign : unit -> unit
113
compile-command: "make -C ../../.."