aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 0554e72..64718c5 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "plugin.h"
#include "c-family/c-ada-spec.h"
+#include "cilk.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
@@ -8447,6 +8448,12 @@ finish_function (void)
/* Tie off the statement tree for this function. */
DECL_SAVED_TREE (fndecl) = pop_stmt_list (DECL_SAVED_TREE (fndecl));
+ /* If the function has _Cilk_spawn in front of a function call inside it
+ i.e. it is a spawning function, then add the appropriate Cilk plus
+ functions inside. */
+ if (fn_contains_cilk_spawn_p (cfun))
+ cfun->cilk_frame_decl = insert_cilk_frame (fndecl);
+
finish_fname_decls ();
/* Complain if there's just no return statement. */