2008-06-14 Adrien Eliche <aeliche@isty.uvsq.fr>
[official-gcc/graphite-test-results.git] / libbounds / bounds-oob.h
blob933734092e273c190aa4e78ee83e1c1e3cf8bd69
1 /* Out-of-bounds pointer representation for libbounds.
2 Copyright (C) 2007, 2008 Free Software Foundation, Inc.
3 Contributed by Alexander Lamaison <awl03@doc.ic.ac.uk>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 In addition to the permissions in the GNU General Public License, the
13 Free Software Foundation gives you unlimited permission to link the
14 compiled version of this file into combinations with other programs,
15 and to distribute those combinations without any restriction coming
16 from the use of this file. (The General Public License restrictions
17 do apply in other respects; for example, they cover modification of
18 the file, and distribution when not linked into a combine
19 executable.)
21 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
22 WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 for more details.
26 You should have received a copy of the GNU General Public License
27 along with GCC; see the file COPYING. If not, write to the Free
28 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
29 02110-1301, USA. */
31 #ifndef _BOUNDS_OOB_H
32 #define _BOUNDS_OOB_H
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
38 #ifdef HAVE_STDINT_H
39 #include <stdint.h>
40 #else
41 typedef unsigned int uintptr_t __attribute__ ((__mode__ (__pointer__)));
42 #endif
44 /* Out-of-bounds object. */
45 typedef struct __bounds_oob_ptr
47 uintptr_t ptr; /* Current pointer value. */
48 uintptr_t last_valid; /* Value of pointer before going out-of-bounds. */
49 const char *arith_location; /* Location where pointer went out-of-bounds. */
51 } __bounds_oob_ptr_t;
53 extern void *__bounds_create_oob (void *, void *, const char *);
54 extern void __bounds_destroy_oob (void *);
55 extern __bounds_oob_ptr_t *__bounds_get_oob (void *);
57 #endif /* _BOUNDS_OOB_H */