summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 7216b897184..8dcccbf19c6 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "profile.h"
#include "params.h"
#include "tree-chkp.h"
+#include "context.h"
/* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this. */
#include "tree-pass.h"
@@ -494,6 +495,14 @@ cgraph_node::create (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
node->decl = decl;
+
+ if (flag_openmp
+ && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
+ {
+ node->offloadable = 1;
+ g->have_offload = true;
+ }
+
node->register_symbol ();
if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)