Merge trunk version 217032 into gupc branch.
[official-gcc.git] / gcc / c-family / c-upc-pts-ops.c
blob9bf4f821b918f7afac9c9fb2b77c7a36c6d54006
1 /* c-upc-pts-ops.c: implement UPC pointer-to-shared-operations.
2 Copyright (C) 2001-2014 Free Software Foundation, Inc.
3 Contributed by Gary Funck <gary@intrepid.com>
4 and Nenad Vukicevic <nenad@intrepid.com>.
5 Based on original implementation
6 by Jesse M. Draper <jdraper@super.org>
7 and William W. Carlson <wwc@super.org>.
9 This file is part of GCC.
11 GCC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
14 any later version.
16 GCC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GCC; see the file COPYING3. If not see
23 <http://www.gnu.org/licenses/>. */
25 #include "config.h"
26 #include "system.h"
27 #include "coretypes.h"
28 #include "tree.h"
29 #include "c-upc-pts-ops.h"
31 /* UPC_PTS is a table of functions that implement various
32 operations on expressions which refer to UPC pointers-to-shared,
33 where their implementation varies with the representation
34 of a pointer-to-shared value. ('packed' or 'struct') */
36 upc_pts_ops_t upc_pts;
38 /* Initialize the handler table for the UPC pointer-to-shared
39 representation that was selected when the compiler
40 was configured. */
42 void
43 upc_pts_init (void)
45 #if HAVE_UPC_PTS_PACKED_REP
46 upc_pts = upc_pts_packed_ops;
47 #elif HAVE_UPC_PTS_STRUCT_REP
48 upc_pts = upc_pts_struct_ops;
49 #else
50 # error either HAVE_UPC_PTS_PACKED_REP or HAVE_UPC_PTS_STRUCT_REP must be defined.
51 #endif
52 /* Define the various pre-defined types and values, like 'upc_shared_ptr_t'
53 that depend upon the representation of UPC pointer-to-shared type. */
54 (*upc_pts.init) ();