diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-03-17 12:19:01 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-03-17 12:19:01 -0700 |
commit | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (patch) | |
tree | a3451277603bc8fbe2eddce5f4ad63f790129a01 /gcc/c/c-decl.c | |
parent | bc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (diff) | |
parent | f3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587 (diff) | |
download | gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.zip gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.gz gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.bz2 |
Merge from trunk revision f3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587.
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r-- | gcc/c/c-decl.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index b559ed5..3b2241b 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -58,6 +58,9 @@ along with GCC; see the file COPYING3. If not see #include "c-family/name-hint.h" #include "c-family/known-headers.h" #include "c-family/c-spellcheck.h" +#include "context.h" /* For 'g'. */ +#include "omp-general.h" +#include "omp-offload.h" /* For offload_vars. */ #include "tree-pretty-print.h" @@ -5658,9 +5661,22 @@ finish_decl (tree decl, location_t init_loc, tree init, DECL_ATTRIBUTES (decl)) && !lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (decl))) - DECL_ATTRIBUTES (decl) - = tree_cons (get_identifier ("omp declare target"), - NULL_TREE, DECL_ATTRIBUTES (decl)); + { + DECL_ATTRIBUTES (decl) + = tree_cons (get_identifier ("omp declare target"), + NULL_TREE, DECL_ATTRIBUTES (decl)); + symtab_node *node = symtab_node::get (decl); + if (node != NULL) + { + node->offloadable = 1; + if (ENABLE_OFFLOADING) + { + g->have_offload = true; + if (is_a <varpool_node *> (node)) + vec_safe_push (offload_vars, decl); + } + } + } } /* This is the last point we can lower alignment so give the target the |