Implement TARGET_SET_CURRENT_FUNCTION for nvptx. This gives us a place to
add initialization or reset actions that need to be executed on a per-function
basis.
Build and reg-tested on x86_64 with nvptx accelerator.
2018-12-19 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare.
(nvptx_set_current_function): New function.
(TARGET_SET_CURRENT_FUNCTION): Define.
From-SVN: r267256
+2018-12-19 Tom de Vries <tdevries@suse.de>
+
+ * config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare.
+ (nvptx_set_current_function): New function.
+ (TARGET_SET_CURRENT_FUNCTION): Define.
+
2018-12-19 Shaokun Zhang <zhangshaokun@hisilicon.com>
* config/aarch64/aarch64-cores.def (tsv110): Fix architecture. This
return false;
}
+static GTY(()) tree nvptx_previous_fndecl;
+
+static void
+nvptx_set_current_function (tree fndecl)
+{
+ if (!fndecl || fndecl == nvptx_previous_fndecl)
+ return;
+
+ nvptx_previous_fndecl = fndecl;
+}
+
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE nvptx_option_override
#undef TARGET_HAVE_SPECULATION_SAFE_VALUE
#define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
+#undef TARGET_SET_CURRENT_FUNCTION
+#define TARGET_SET_CURRENT_FUNCTION nvptx_set_current_function
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-nvptx.h"