(**************************************************************************)
(*                                                                        *)
   This file is part of   .                              
(*                                                                        *)
     is a fork of Frama - C. All the differences are :     
     Copyright ( C ) 2016 - 2017  
(*                                                                        *)
     is released under GPLv2                            
(*                                                                        *)
(**************************************************************************)

(****************************************************************************)
(*                                                                          *)
   Copyright ( C ) 2001 - 2003                                                 
           <  >                           
(*   Scott McPeak        <>                          *)
                <  >                           
                <  >                           
(*  All rights reserved.                                                    *)
(*                                                                          *)
(*  Redistribution and use in source and binary forms, with or without      *)
(*  modification, are permitted provided that the following conditions      *)
(*  are met:                                                                *)
(*                                                                          *)
   1 . Redistributions of source code must retain the above copyright       
(*  notice, this list of conditions and the following disclaimer.           *)
(*                                                                          *)
   2 . Redistributions in binary form must reproduce the above copyright    
(*  notice, this list of conditions and the following disclaimer in the     *)
(*  documentation and/or other materials provided with the distribution.    *)
(*                                                                          *)
   3 . The names of the contributors may not be used to endorse or          
(*  promote products derived from this software without specific prior      *)
(*  written permission.                                                     *)
(*                                                                          *)
(*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     *)
   " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT       
(*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       *)
(*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE          *)
   COPYRIGHT OWNER OR    FOR ANY DIRECT , INDIRECT ,     
   INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,    
   BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;        
(*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER        *)
   CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT      
(*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN       *)
(*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         *)
(*  POSSIBILITY OF SUCH DAMAGE.                                             *)
(*                                                                          *)
   File modified by CEA ( Commissariat à l'énergie atomique et aux          
(*                        énergies alternatives)                            *)
                and INRIA ( Institut National de Recherche en Informatique  
(*                          et Automatique).                                *)
(****************************************************************************)

(** Cabs2cil combining types and conditional conversion. *)

open Cil_types

type combineWhat =
    CombineFundef of bool
  (** The new definition is for a function definition. The old is for
      a prototype. (The argument is [true] for an old-style declaration. *)
  | CombineFunarg of bool
* Comparing a function argument type with an old prototype argument . 
       ( The argument is [ true ] for an old - style declaration , which triggers some 
       ad'hoc treatment in GCC mode .
      (The argument is [true] for an old-style declaration, which triggers some
      ad'hoc treatment in GCC mode. *)
  | CombineFunret (** Comparing the return of a function with that from an old
                      prototype. *)
  | CombineOther

* Combine the types . Raise the [ Failure ] exception with an explanation 
     if the two types are not compatible .
    if the two types are not compatible. *)
val combineTypes : combineWhat -> typ -> typ -> typ

* Check that the two given types are compatible ( C99 , 6.2.7 ) , and 
     return their composite type . Raise [ Failure ] with an explanation 
     if the two types are not compatible . 

     @since Oxygen-20120901 

    return their composite type. Raise [Failure] with an explanation
    if the two types are not compatible.

    @since Oxygen-20120901
*)
val compatibleTypes : typ -> typ -> typ

* Check that the two given types are compatible ( C99 , 6.2.7 ) , and 
     return a boolean . 

     @since Neon-20140301 

    return a boolean.

    @since Neon-20140301
*)
val compatibleTypesp : typ -> typ -> bool

(** TODO: ??? *)
val conditionalConversion : typ -> typ -> typ

(** Return the type of the result of a logic operator applied to values of
    the corresponding input types. *)
val logicConditionalConversion : typ -> typ -> typ

val clear_env : unit -> unit

************************************************************************
                                                                        
                                                                        
                                                                        
                                                                        
************************************************************************
**************************************************************************
                                                                          
   Scott McPeak        <>                          
  All rights reserved.                                                    
                                                                          
  Redistribution and use in source and binary forms, with or without      
  modification, are permitted provided that the following conditions      
  are met:                                                                
                                                                          
  notice, this list of conditions and the following disclaimer.           
                                                                          
  notice, this list of conditions and the following disclaimer in the     
  documentation and/or other materials provided with the distribution.    
                                                                          
  promote products derived from this software without specific prior      
  written permission.                                                     
                                                                          
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       
  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE          
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER        
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN       
  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         
  POSSIBILITY OF SUCH DAMAGE.                                             
                                                                          
                        énergies alternatives)                            
                          et Automatique).                                
**************************************************************************
* Cabs2cil combining types and conditional conversion. 
* The new definition is for a function definition. The old is for
      a prototype. (The argument is [true] for an old-style declaration. 
* Comparing the return of a function with that from an old
                      prototype. 
* TODO: ??? 
* Return the type of the result of a logic operator applied to values of
    the corresponding input types. 
   This file is part of   .                              
     is a fork of Frama - C. All the differences are :     
     Copyright ( C ) 2016 - 2017  
     is released under GPLv2                            

   Copyright ( C ) 2001 - 2003                                                 
           <  >                           
                <  >                           
                <  >                           
   1 . Redistributions of source code must retain the above copyright       
   2 . Redistributions in binary form must reproduce the above copyright    
   3 . The names of the contributors may not be used to endorse or          
   " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT       
   COPYRIGHT OWNER OR    FOR ANY DIRECT , INDIRECT ,     
   INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,    
   BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;        
   CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT      
   File modified by CEA ( Commissariat à l'énergie atomique et aux          
                and INRIA ( Institut National de Recherche en Informatique  


open Cil_types

type combineWhat =
    CombineFundef of bool
  | CombineFunarg of bool
* Comparing a function argument type with an old prototype argument . 
       ( The argument is [ true ] for an old - style declaration , which triggers some 
       ad'hoc treatment in GCC mode .
      (The argument is [true] for an old-style declaration, which triggers some
      ad'hoc treatment in GCC mode. *)
  | CombineOther

* Combine the types . Raise the [ Failure ] exception with an explanation 
     if the two types are not compatible .
    if the two types are not compatible. *)
val combineTypes : combineWhat -> typ -> typ -> typ

* Check that the two given types are compatible ( C99 , 6.2.7 ) , and 
     return their composite type . Raise [ Failure ] with an explanation 
     if the two types are not compatible . 

     @since Oxygen-20120901 

    return their composite type. Raise [Failure] with an explanation
    if the two types are not compatible.

    @since Oxygen-20120901
*)
val compatibleTypes : typ -> typ -> typ

* Check that the two given types are compatible ( C99 , 6.2.7 ) , and 
     return a boolean . 

     @since Neon-20140301 

    return a boolean.

    @since Neon-20140301
*)
val compatibleTypesp : typ -> typ -> bool

val conditionalConversion : typ -> typ -> typ

val logicConditionalConversion : typ -> typ -> typ

val clear_env : unit -> unit
