@@ -307,14 +307,6 @@ brig_string_slot_hasher::remove (value_type ds)
static hash_table<brig_string_slot_hasher> *brig_string_htab;
-static void
-sanitize_hsa_name (char *p)
-{
- for (; *p; p++)
- if (*p == '.')
- *p = '_';
-}
-
/* Emit a null terminated string STR to the data section and return its
offset in it. If PREFIX is non-zero, output it just before STR too. */
@@ -330,7 +322,7 @@ brig_emit_string (const char *str, char prefix = 0)
/* XXX Sanitize the names without all the strdup. */
str2 = xstrdup (str);
- sanitize_hsa_name (str2);
+ hsa_sanitize_name (str2);
s_slot.s = str2;
s_slot.len = slen;
s_slot.prefix = prefix;
@@ -2266,14 +2266,6 @@ gen_function_parameters (vec <hsa_op_reg_p> ssa_map)
}
}
-static void
-sanitize_hsa_name (char *p)
-{
- for (; *p; p++)
- if (*p == '.')
- *p = '_';
-}
-
/* Genrate HSAIL reprezentation of the current function and write into a
special section of the output file. If KERNEL is set, the function will be
considered an HSA kernel callable from the host, otherwise it will be
@@ -2290,7 +2282,7 @@ generate_hsa (bool kernel)
ssa_map.safe_grow_cleared (SSANAMES (cfun)->length ());
hsa_cfun.name
= xstrdup (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
- sanitize_hsa_name (hsa_cfun.name);
+ hsa_sanitize_name (hsa_cfun.name);
if (hsa_cfun.kern_p)
hsa_add_kern_decl_mapping (current_function_decl, hsa_cfun.name);
@@ -292,4 +292,14 @@ hsa_free_decl_kernel_mapping (void)
ggc_free (hsa_decl_kernel_mapping);
}
+/* Modify the name P in-place so that it is a valid HSA identifier. */
+
+void
+hsa_sanitize_name (char *p)
+{
+ for (; *p; p++)
+ if (*p == '.')
+ *p = '_';
+}
+
#include "gt-hsa.h"
@@ -619,6 +619,7 @@ unsigned hsa_get_number_decl_kernel_mappings (void);
tree hsa_get_decl_kernel_mapping_decl (unsigned i);
char *hsa_get_decl_kernel_mapping_name (unsigned i);
void hsa_free_decl_kernel_mapping (void);
+void hsa_sanitize_name (char *p);
/* In hsa-gen.c. */
void hsa_build_append_simple_mov (hsa_op_reg *, hsa_op_base *, hsa_bb *);