Skip to content

Commit ef443c4

Browse files
committed
Cleanup
1 parent 8bed3aa commit ef443c4

File tree

8 files changed

+23
-32
lines changed

8 files changed

+23
-32
lines changed

gcc/cgraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see
2525
#include "ipa-ref.h"
2626
#include "plugin-api.h"
2727
#include "ipa-param-manipulation.h"
28-
#include "print-tree.h"
2928

3029
extern void debuginfo_early_init (void);
3130
extern void debuginfo_init (void);

gcc/cgraphunit.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,9 @@ symtab_node::needed_p (void)
240240
/* Double check that no one output the function into assembly file
241241
early. */
242242
if (!native_rtl_p ())
243-
{
244-
if (!(!DECL_ASSEMBLER_NAME_SET_P (decl)
245-
|| !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
246-
debug_tree (decl);
247243
gcc_checking_assert
248244
(!DECL_ASSEMBLER_NAME_SET_P (decl)
249245
|| !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)));
250-
}
251246

252247
if (!definition)
253248
return false;
@@ -1395,7 +1390,7 @@ analyze_functions (bool first_time)
13951390
|| cnode->alias
13961391
|| gimple_has_body_p (decl)
13971392
|| cnode->native_rtl_p ());
1398-
gcc_assert (cnode->analyzed == cnode->definition);
1393+
gcc_assert (cnode->analyzed == cnode->definition);
13991394
}
14001395
node->aux = NULL;
14011396
}

gcc/dwarf2asm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ compare_strings (const void *a, const void *b)
938938
/* The strings are always those from IDENTIFIER_NODEs, and,
939939
therefore, we should never have two copies of the same
940940
string. */
941-
//gcc_assert (ret);
941+
gcc_assert (ret);
942942

943943
return ret;
944944
}

gcc/ipa-visibility.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -709,15 +709,6 @@ function_and_variable_visibility (bool whole_program)
709709
}
710710
node->dissolve_same_comdat_group_list ();
711711
}
712-
if (!((!DECL_WEAK (node->decl)
713-
&& !DECL_COMDAT (node->decl))
714-
|| TREE_PUBLIC (node->decl)
715-
|| node->weakref
716-
|| DECL_EXTERNAL (node->decl)))
717-
{
718-
fprintf (stderr, "%d, %d, %d, %d, %d\n", DECL_WEAK (node->decl), DECL_COMDAT (node->decl), TREE_PUBLIC (node->decl), node->weakref, DECL_EXTERNAL (node->decl));
719-
debug_tree (node->decl);
720-
}
721712
gcc_assert ((!DECL_WEAK (node->decl)
722713
&& !DECL_COMDAT (node->decl))
723714
|| TREE_PUBLIC (node->decl)

gcc/jit/jit-playback.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,6 @@ void
21702170
playback::function::
21712171
set_personality_function (function *personality_function)
21722172
{
2173-
//fprintf (stderr, "************* Setting personality function %s for %s\n", IDENTIFIER_POINTER (DECL_NAME (personality_function->as_fndecl ())), IDENTIFIER_POINTER (DECL_NAME (m_inner_fndecl)));
21742173
DECL_FUNCTION_PERSONALITY (m_inner_fndecl) = personality_function->as_fndecl ();
21752174
}
21762175

@@ -2336,8 +2335,8 @@ add_try_catch (location *loc,
23362335
{
23372336
tree success_body = alloc_stmt_list ();
23382337

2339-
// TODO: find a better way to keep the EH_ELSE_EXPR than creating a nop via inline asm.
2340-
tree t_string = build_string ("nop");
2338+
// TODO: find a better way to keep the EH_ELSE_EXPR than creating an empty inline asm.
2339+
tree t_string = build_string ("");
23412340
tree asm_stmt
23422341
= build5 (ASM_EXPR, void_type_node, t_string, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE);
23432342

@@ -2347,6 +2346,8 @@ add_try_catch (location *loc,
23472346
ASM_INPUT_P (asm_stmt) = 0;
23482347
append_to_statement_list (asm_stmt, &success_body);
23492348

2349+
// TODO: Don't automatically add the `EH_ELSE_EXPR`. Make an API to create such a node and let the user of libgccjit
2350+
// add it manually.
23502351
catch_body = build2 (EH_ELSE_EXPR, void_type_node, success_body, catch_body);
23512352
add_stmt (build2 (TRY_FINALLY_EXPR, void_type_node,
23522353
try_body, catch_body));

gcc/jit/jit-recording.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4632,8 +4632,6 @@ recording::block::add_try_catch (location *loc,
46324632
bool is_finally)
46334633
{
46344634
statement *result = new try_catch (this, loc, try_block, catch_block, is_finally);
4635-
//try_block->m_has_been_terminated = true;
4636-
//catch_block->m_has_been_terminated = true;
46374635
try_block->m_is_reachable = true;
46384636
catch_block->m_is_reachable = true;
46394637
m_ctxt->record (result);
@@ -7127,8 +7125,13 @@ recording::try_catch::replay_into (replayer *r)
71277125
recording::string *
71287126
recording::try_catch::make_debug_string ()
71297127
{
7130-
// TODO: handle m_is_finally.
7131-
return string::from_printf (m_ctxt,
7128+
if (m_is_finally)
7129+
return string::from_printf (m_ctxt,
7130+
"try { %s } finally { %s };",
7131+
m_try_block->get_debug_string (),
7132+
m_catch_block->get_debug_string ());
7133+
else
7134+
return string::from_printf (m_ctxt,
71327135
"try { %s } catch { %s };",
71337136
m_try_block->get_debug_string (),
71347137
m_catch_block->get_debug_string ());
@@ -7140,11 +7143,14 @@ recording::try_catch::make_debug_string ()
71407143
void
71417144
recording::try_catch::write_reproducer (reproducer &r)
71427145
{
7143-
// TODO: handle m_is_finally.
7144-
r.write (" gcc_jit_block_add_try_catch (%s, /*gcc_jit_block *block */\n"
7146+
const char *func_name = "gcc_jit_block_add_try_catch";
7147+
if (m_is_finally)
7148+
func_name = "gcc_jit_block_add_try_finally";
7149+
r.write (" %s (%s, /*gcc_jit_block *block */\n"
71457150
" %s, /* gcc_jit_location *loc */\n"
71467151
" %s, /* gcc_jit_block *try_block */\n"
71477152
" %s); /* gcc_jit_block *catch_block */\n",
7153+
func_name,
71487154
r.get_identifier (get_block ()),
71497155
r.get_identifier (get_loc ()),
71507156
r.get_identifier (m_try_block),

gcc/jit/libgccjit.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,7 @@ gcc_jit_block_add_try_catch (gcc_jit_block *block,
29572957

29582958
gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, catch_block);
29592959

2960+
// TODO: remove this or use it.
29602961
/* "stmt" should be good enough to be usable in error-messages,
29612962
but might still not be compilable; perform some more
29622963
error-checking here. We do this here so that the error messages
@@ -2985,6 +2986,7 @@ gcc_jit_block_add_try_finally (gcc_jit_block *block,
29852986

29862987
gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, finally_block, true);
29872988

2989+
// TODO: remove this or use it.
29882990
/* "stmt" should be good enough to be usable in error-messages,
29892991
but might still not be compilable; perform some more
29902992
error-checking here. We do this here so that the error messages

gcc/tree-eh.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4882,13 +4882,10 @@ pass_cleanup_eh::execute (function *fun)
48824882
/* If the function no longer needs an EH personality routine
48834883
clear it. This exposes cross-language inlining opportunities
48844884
and avoids references to a never defined personality routine. */
4885-
if (DECL_FUNCTION_PERSONALITY (current_function_decl)
4885+
// TODO: uncomment and find out why this doesn't work.
4886+
/*if (DECL_FUNCTION_PERSONALITY (current_function_decl)
48864887
&& function_needs_eh_personality (fun) != eh_personality_lang)
4887-
{
4888-
//fprintf(stderr, "Unset personality function for %s\n", IDENTIFIER_POINTER (DECL_NAME (current_function_decl)));
4889-
// TODO: uncomment:
4890-
//DECL_FUNCTION_PERSONALITY (current_function_decl) = NULL_TREE;
4891-
}
4888+
DECL_FUNCTION_PERSONALITY (current_function_decl) = NULL_TREE;*/
48924889

48934890
return ret;
48944891
}

0 commit comments

Comments
 (0)