Skip to content

Commit c3fbd89

Browse files
committed
revert(playback): Add DECL_ASSEMBLER_NAME back & make func. public
If the short name is found, set `DECL_ASSEMBLER_NAME` to the function name and make the fndecl tree public.
1 parent 97e694c commit c3fbd89

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gcc/jit/jit-playback.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,10 @@ new_function (location *loc,
698698
}
699699
}
700700

701+
bool short_name_found = false;
702+
bool should_test_short_name = get_bool_option(GCC_JIT_BOOL_OPTION_DEBUGINFO)
703+
&& get_bool_option(GCC_JIT_BOOL_OPTION_MANGLED_FUNCTION_NAME);
704+
701705
for (auto attr: string_attributes)
702706
{
703707
gcc_jit_fn_attribute& name = std::get<0>(attr);
@@ -707,10 +711,21 @@ new_function (location *loc,
707711
const char* attribute = fn_attribute_to_string (name);
708712
tree ident = attribute ? get_identifier (attribute) : NULL;
709713

714+
if (should_test_short_name && GCC_JIT_FN_ATTRIBUTE_JIT_DWARF_SHORT_NAME == name) {
715+
short_name_found = true;
716+
should_test_short_name = false;
717+
}
718+
710719
if (ident)
711720
fn_attributes = tree_cons (ident, attribute_value, fn_attributes);
712721
}
713722

723+
if (short_name_found)
724+
{
725+
SET_DECL_ASSEMBLER_NAME(fndecl, get_identifier(name));
726+
TREE_PUBLIC(fndecl) = 1;
727+
}
728+
714729
for (auto attr: int_array_attributes)
715730
{
716731
gcc_jit_fn_attribute& name = std::get<0>(attr);

0 commit comments

Comments
 (0)