]>
Commit | Line | Data |
---|---|---|
1 | /* brig-fbarrier-handler.cc -- brig fbarrier directive handling | |
2 | Copyright (C) 2016-2020 Free Software Foundation, Inc. | |
3 | Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com> | |
4 | for General Processor Tech. | |
5 | ||
6 | This file is part of GCC. | |
7 | ||
8 | GCC is free software; you can redistribute it and/or modify it under | |
9 | the terms of the GNU General Public License as published by the Free | |
10 | Software Foundation; either version 3, or (at your option) any later | |
11 | version. | |
12 | ||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GCC; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. */ | |
21 | ||
22 | #include "brig-code-entry-handler.h" | |
23 | ||
24 | #include "stringpool.h" | |
25 | #include "errors.h" | |
26 | ||
27 | /* Allocate this many bytes from the group segment for each fbarrier. */ | |
28 | #define FBARRIER_STRUCT_SIZE 32 | |
29 | ||
30 | size_t | |
31 | brig_directive_fbarrier_handler::operator () (const BrigBase *base) | |
32 | { | |
33 | /* Model fbarriers as group segment variables with fixed size | |
34 | large enough to store whatever data the actual target needs | |
35 | to store to maintain the barrier info. The handle is the | |
36 | offset to the beginning of the object. */ | |
37 | ||
38 | const BrigDirectiveFbarrier* fbar = (const BrigDirectiveFbarrier*)base; | |
39 | if (m_parent.m_cf != NULL) | |
40 | m_parent.m_cf->m_function_scope_vars.insert (base); | |
41 | std::string var_name = m_parent.get_mangled_name (fbar); | |
42 | m_parent.add_group_variable (var_name, FBARRIER_STRUCT_SIZE, 1, | |
43 | m_parent.m_cf != NULL); | |
44 | return base->byteCount; | |
45 | } |