1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495(****************************************************************************)(* *)(* This file is part of MOPSA, a Modular Open Platform for Static Analysis. *)(* *)(* Copyright (C) 2017-2019 The MOPSA Project. *)(* *)(* This program is free software: you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License as published *)(* by the Free Software Foundation, either version 3 of the License, or *)(* (at your option) any later version. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* along with this program. If not, see <http://www.gnu.org/licenses/>. *)(* *)(****************************************************************************)(**
Clang_utils - Utilities for the Clang AST
*)openClang_AST(** {1 Locations} *)letempty_loc={loc_line=-1;loc_column=-1;loc_file="<invalid>";}letempty_eloc={eloc_loc=empty_loc;eloc_stack=[];}letempty_range={range_begin=empty_eloc;range_end=empty_eloc;}letmk_elocl={empty_elocwitheloc_loc=l;}letloc_is_emptyl=l.loc_line<0||l.loc_column<0||l.loc_file="<invalid>"leteloc_is_emptyl=loc_is_emptyl.eloc_loc&&l.eloc_stack=[]letrange_is_emptyr=eloc_is_emptyr.range_begin&&eloc_is_emptyr.range_end(** {1 Types} *)lettarget_unsigned_int=function|Target_NoInt->Target_NoInt|Target_SignedChar|Target_UnsignedChar->Target_UnsignedChar|Target_SignedShort|Target_UnsignedShort->Target_UnsignedShort|Target_SignedInt|Target_UnsignedInt->Target_UnsignedInt|Target_SignedLong|Target_UnsignedLong->Target_UnsignedLong|Target_SignedLongLong|Target_UnsignedLongLong->Target_UnsignedLongLong(** Unsigned version of an int. *)letint_type_align(t:target_info)=function|Target_NoInt->0|Target_SignedChar|Target_UnsignedChar->t.target_char_align|Target_SignedShort|Target_UnsignedShort->t.target_short_align|Target_SignedInt|Target_UnsignedInt->t.target_int_align|Target_SignedLong|Target_UnsignedLong->t.target_long_align|Target_SignedLongLong|Target_UnsignedLongLong->t.target_long_long_align(** Alignment of an int type for the target. *)letreal_type_align(t:target_info)=function|Target_NoFloat->0|Target_Float->t.target_float_align|Target_Double->t.target_double_align|Target_LongDouble->t.target_long_double_align|Target_Float128->t.target_float128_align(** Alignment of a real (float) type for the target. *)letint_type_width(t:target_info)=function|Target_NoInt->0|Target_SignedChar|Target_UnsignedChar->t.target_char_width|Target_SignedShort|Target_UnsignedShort->t.target_short_width|Target_SignedInt|Target_UnsignedInt->t.target_int_width|Target_SignedLong|Target_UnsignedLong->t.target_long_width|Target_SignedLongLong|Target_UnsignedLongLong->t.target_long_long_width(** Bit-width of an int type for the target. *)letreal_type_width(t:target_info)=function|Target_NoFloat->0|Target_Float->t.target_float_width|Target_Double->t.target_double_width|Target_LongDouble->t.target_long_double_width|Target_Float128->t.target_float128_width(** Bit-width of a real (float) type for the target. *)(** {1 Debugging utilities} *)externaldump_block:recursive:bool->'a->unit="mlclang_dump_block"