hexsha
stringlengths 40
40
| repo
stringlengths 5
105
| path
stringlengths 3
173
| license
sequence | language
stringclasses 1
value | identifier
stringlengths 1
438
| return_type
stringlengths 1
106
⌀ | original_string
stringlengths 21
40.7k
| original_docstring
stringlengths 18
13.4k
| docstring
stringlengths 11
3.24k
| docstring_tokens
sequence | code
stringlengths 14
20.4k
| code_tokens
sequence | short_docstring
stringlengths 0
4.36k
| short_docstring_tokens
sequence | comment
sequence | parameters
list | docstring_params
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | loopify | null | struct loop *
loopify (edge latch_edge, edge header_edge,
basic_block switch_bb, edge true_edge, edge false_edge,
bool redirect_all_edges, unsigned true_scale, unsigned false_scale)
{
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
struct loop *loop = alloc_loop ();
struct loop *outer = loop_outer (succ_bb->loop_father);
int freq;
gcov_type cnt;
edge e;
edge_iterator ei;
loop->header = header_edge->dest;
loop->latch = latch_edge->src;
freq = EDGE_FREQUENCY (header_edge);
cnt = header_edge->count;
/* Redirect edges. */
loop_redirect_edge (latch_edge, loop->header);
loop_redirect_edge (true_edge, succ_bb);
/* During loop versioning, one of the switch_bb edge is already properly
set. Do not redirect it again unless redirect_all_edges is true. */
if (redirect_all_edges)
{
loop_redirect_edge (header_edge, switch_bb);
loop_redirect_edge (false_edge, loop->header);
/* Update dominators. */
set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb);
set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb);
}
set_immediate_dominator (CDI_DOMINATORS, succ_bb, switch_bb);
/* Compute new loop. */
add_loop (loop, outer);
/* Add switch_bb to appropriate loop. */
if (switch_bb->loop_father)
remove_bb_from_loops (switch_bb);
add_bb_to_loop (switch_bb, outer);
/* Fix frequencies. */
if (redirect_all_edges)
{
switch_bb->frequency = freq;
switch_bb->count = cnt;
FOR_EACH_EDGE (e, ei, switch_bb->succs)
{
e->count = (switch_bb->count * e->probability) / REG_BR_PROB_BASE;
}
}
scale_loop_frequencies (loop, false_scale, REG_BR_PROB_BASE);
scale_loop_frequencies (succ_bb->loop_father, true_scale, REG_BR_PROB_BASE);
update_dominators_in_loop (loop);
return loop;
} | /* Make area between HEADER_EDGE and LATCH_EDGE a loop by connecting
latch to header and update loop tree and dominators
accordingly. Everything between them plus LATCH_EDGE destination must
be dominated by HEADER_EDGE destination, and back-reachable from
LATCH_EDGE source. HEADER_EDGE is redirected to basic block SWITCH_BB,
FALSE_EDGE of SWITCH_BB to original destination of HEADER_EDGE and
TRUE_EDGE of SWITCH_BB to original destination of LATCH_EDGE.
Returns the newly created loop. Frequencies and counts in the new loop
are scaled by FALSE_SCALE and in the old one by TRUE_SCALE. */ | Make area between HEADER_EDGE and LATCH_EDGE a loop by connecting
latch to header and update loop tree and dominators
accordingly. Everything between them plus LATCH_EDGE destination must
be dominated by HEADER_EDGE destination, and back-reachable from
LATCH_EDGE source. | [
"Make",
"area",
"between",
"HEADER_EDGE",
"and",
"LATCH_EDGE",
"a",
"loop",
"by",
"connecting",
"latch",
"to",
"header",
"and",
"update",
"loop",
"tree",
"and",
"dominators",
"accordingly",
".",
"Everything",
"between",
"them",
"plus",
"LATCH_EDGE",
"destination",
"must",
"be",
"dominated",
"by",
"HEADER_EDGE",
"destination",
"and",
"back",
"-",
"reachable",
"from",
"LATCH_EDGE",
"source",
"."
] | struct loop *
loopify (edge latch_edge, edge header_edge,
basic_block switch_bb, edge true_edge, edge false_edge,
bool redirect_all_edges, unsigned true_scale, unsigned false_scale)
{
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
struct loop *loop = alloc_loop ();
struct loop *outer = loop_outer (succ_bb->loop_father);
int freq;
gcov_type cnt;
edge e;
edge_iterator ei;
loop->header = header_edge->dest;
loop->latch = latch_edge->src;
freq = EDGE_FREQUENCY (header_edge);
cnt = header_edge->count;
loop_redirect_edge (latch_edge, loop->header);
loop_redirect_edge (true_edge, succ_bb);
if (redirect_all_edges)
{
loop_redirect_edge (header_edge, switch_bb);
loop_redirect_edge (false_edge, loop->header);
set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb);
set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb);
}
set_immediate_dominator (CDI_DOMINATORS, succ_bb, switch_bb);
add_loop (loop, outer);
if (switch_bb->loop_father)
remove_bb_from_loops (switch_bb);
add_bb_to_loop (switch_bb, outer);
if (redirect_all_edges)
{
switch_bb->frequency = freq;
switch_bb->count = cnt;
FOR_EACH_EDGE (e, ei, switch_bb->succs)
{
e->count = (switch_bb->count * e->probability) / REG_BR_PROB_BASE;
}
}
scale_loop_frequencies (loop, false_scale, REG_BR_PROB_BASE);
scale_loop_frequencies (succ_bb->loop_father, true_scale, REG_BR_PROB_BASE);
update_dominators_in_loop (loop);
return loop;
} | [
"struct",
"loop",
"*",
"loopify",
"(",
"edge",
"latch_edge",
",",
"edge",
"header_edge",
",",
"basic_block",
"switch_bb",
",",
"edge",
"true_edge",
",",
"edge",
"false_edge",
",",
"bool",
"redirect_all_edges",
",",
"unsigned",
"true_scale",
",",
"unsigned",
"false_scale",
")",
"{",
"basic_block",
"succ_bb",
"=",
"latch_edge",
"->",
"dest",
";",
"basic_block",
"pred_bb",
"=",
"header_edge",
"->",
"src",
";",
"struct",
"loop",
"*",
"loop",
"=",
"alloc_loop",
"(",
")",
";",
"struct",
"loop",
"*",
"outer",
"=",
"loop_outer",
"(",
"succ_bb",
"->",
"loop_father",
")",
";",
"int",
"freq",
";",
"gcov_type",
"cnt",
";",
"edge",
"e",
";",
"edge_iterator",
"ei",
";",
"loop",
"->",
"header",
"=",
"header_edge",
"->",
"dest",
";",
"loop",
"->",
"latch",
"=",
"latch_edge",
"->",
"src",
";",
"freq",
"=",
"EDGE_FREQUENCY",
"(",
"header_edge",
")",
";",
"cnt",
"=",
"header_edge",
"->",
"count",
";",
"loop_redirect_edge",
"(",
"latch_edge",
",",
"loop",
"->",
"header",
")",
";",
"loop_redirect_edge",
"(",
"true_edge",
",",
"succ_bb",
")",
";",
"if",
"(",
"redirect_all_edges",
")",
"{",
"loop_redirect_edge",
"(",
"header_edge",
",",
"switch_bb",
")",
";",
"loop_redirect_edge",
"(",
"false_edge",
",",
"loop",
"->",
"header",
")",
";",
"set_immediate_dominator",
"(",
"CDI_DOMINATORS",
",",
"switch_bb",
",",
"pred_bb",
")",
";",
"set_immediate_dominator",
"(",
"CDI_DOMINATORS",
",",
"loop",
"->",
"header",
",",
"switch_bb",
")",
";",
"}",
"set_immediate_dominator",
"(",
"CDI_DOMINATORS",
",",
"succ_bb",
",",
"switch_bb",
")",
";",
"add_loop",
"(",
"loop",
",",
"outer",
")",
";",
"if",
"(",
"switch_bb",
"->",
"loop_father",
")",
"remove_bb_from_loops",
"(",
"switch_bb",
")",
";",
"add_bb_to_loop",
"(",
"switch_bb",
",",
"outer",
")",
";",
"if",
"(",
"redirect_all_edges",
")",
"{",
"switch_bb",
"->",
"frequency",
"=",
"freq",
";",
"switch_bb",
"->",
"count",
"=",
"cnt",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"switch_bb",
"->",
"succs",
")",
"",
"{",
"e",
"->",
"count",
"=",
"(",
"switch_bb",
"->",
"count",
"*",
"e",
"->",
"probability",
")",
"/",
"REG_BR_PROB_BASE",
";",
"}",
"}",
"scale_loop_frequencies",
"(",
"loop",
",",
"false_scale",
",",
"REG_BR_PROB_BASE",
")",
";",
"scale_loop_frequencies",
"(",
"succ_bb",
"->",
"loop_father",
",",
"true_scale",
",",
"REG_BR_PROB_BASE",
")",
";",
"update_dominators_in_loop",
"(",
"loop",
")",
";",
"return",
"loop",
";",
"}"
] | Make area between HEADER_EDGE and LATCH_EDGE a loop by connecting
latch to header and update loop tree and dominators
accordingly. | [
"Make",
"area",
"between",
"HEADER_EDGE",
"and",
"LATCH_EDGE",
"a",
"loop",
"by",
"connecting",
"latch",
"to",
"header",
"and",
"update",
"loop",
"tree",
"and",
"dominators",
"accordingly",
"."
] | [
"/* Redirect edges. */",
"/* During loop versioning, one of the switch_bb edge is already properly\n set. Do not redirect it again unless redirect_all_edges is true. */",
"/* Update dominators. */",
"/* Compute new loop. */",
"/* Add switch_bb to appropriate loop. */",
"/* Fix frequencies. */"
] | [
{
"param": "latch_edge",
"type": "edge"
},
{
"param": "header_edge",
"type": "edge"
},
{
"param": "switch_bb",
"type": "basic_block"
},
{
"param": "true_edge",
"type": "edge"
},
{
"param": "false_edge",
"type": "edge"
},
{
"param": "redirect_all_edges",
"type": "bool"
},
{
"param": "true_scale",
"type": "unsigned"
},
{
"param": "false_scale",
"type": "unsigned"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "latch_edge",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "header_edge",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "switch_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "true_edge",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "false_edge",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "redirect_all_edges",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "true_scale",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "false_scale",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | unloop | void | static void
unloop (struct loop *loop, bool *irred_invalidated)
{
basic_block *body;
struct loop *ploop;
unsigned i, n;
basic_block latch = loop->latch;
bool dummy = false;
if (loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)
*irred_invalidated = true;
/* This is relatively straightforward. The dominators are unchanged, as
loop header dominates loop latch, so the only thing we have to care of
is the placement of loops and basic blocks inside the loop tree. We
move them all to the loop->outer, and then let fix_bb_placements do
its work. */
body = get_loop_body (loop);
n = loop->num_nodes;
for (i = 0; i < n; i++)
if (body[i]->loop_father == loop)
{
remove_bb_from_loops (body[i]);
add_bb_to_loop (body[i], loop_outer (loop));
}
free(body);
while (loop->inner)
{
ploop = loop->inner;
flow_loop_tree_node_remove (ploop);
flow_loop_tree_node_add (loop_outer (loop), ploop);
}
/* Remove the loop and free its data. */
delete_loop (loop);
remove_edge (single_succ_edge (latch));
/* We do not pass IRRED_INVALIDATED to fix_bb_placements here, as even if
there is an irreducible region inside the cancelled loop, the flags will
be still correct. */
fix_bb_placements (latch, &dummy);
} | /* Remove the latch edge of a LOOP and update loops to indicate that
the LOOP was removed. After this function, original loop latch will
have no successor, which caller is expected to fix somehow.
If this may cause the information about irreducible regions to become
invalid, IRRED_INVALIDATED is set to true. */ | Remove the latch edge of a LOOP and update loops to indicate that
the LOOP was removed. After this function, original loop latch will
have no successor, which caller is expected to fix somehow.
If this may cause the information about irreducible regions to become
invalid, IRRED_INVALIDATED is set to true. | [
"Remove",
"the",
"latch",
"edge",
"of",
"a",
"LOOP",
"and",
"update",
"loops",
"to",
"indicate",
"that",
"the",
"LOOP",
"was",
"removed",
".",
"After",
"this",
"function",
"original",
"loop",
"latch",
"will",
"have",
"no",
"successor",
"which",
"caller",
"is",
"expected",
"to",
"fix",
"somehow",
".",
"If",
"this",
"may",
"cause",
"the",
"information",
"about",
"irreducible",
"regions",
"to",
"become",
"invalid",
"IRRED_INVALIDATED",
"is",
"set",
"to",
"true",
"."
] | static void
unloop (struct loop *loop, bool *irred_invalidated)
{
basic_block *body;
struct loop *ploop;
unsigned i, n;
basic_block latch = loop->latch;
bool dummy = false;
if (loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)
*irred_invalidated = true;
body = get_loop_body (loop);
n = loop->num_nodes;
for (i = 0; i < n; i++)
if (body[i]->loop_father == loop)
{
remove_bb_from_loops (body[i]);
add_bb_to_loop (body[i], loop_outer (loop));
}
free(body);
while (loop->inner)
{
ploop = loop->inner;
flow_loop_tree_node_remove (ploop);
flow_loop_tree_node_add (loop_outer (loop), ploop);
}
delete_loop (loop);
remove_edge (single_succ_edge (latch));
fix_bb_placements (latch, &dummy);
} | [
"static",
"void",
"unloop",
"(",
"struct",
"loop",
"*",
"loop",
",",
"bool",
"*",
"irred_invalidated",
")",
"{",
"basic_block",
"*",
"body",
";",
"struct",
"loop",
"*",
"ploop",
";",
"unsigned",
"i",
",",
"n",
";",
"basic_block",
"latch",
"=",
"loop",
"->",
"latch",
";",
"bool",
"dummy",
"=",
"false",
";",
"if",
"(",
"loop_preheader_edge",
"(",
"loop",
")",
"->",
"flags",
"&",
"EDGE_IRREDUCIBLE_LOOP",
")",
"*",
"irred_invalidated",
"=",
"true",
";",
"body",
"=",
"get_loop_body",
"(",
"loop",
")",
";",
"n",
"=",
"loop",
"->",
"num_nodes",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"if",
"(",
"body",
"[",
"i",
"]",
"->",
"loop_father",
"==",
"loop",
")",
"{",
"remove_bb_from_loops",
"(",
"body",
"[",
"i",
"]",
")",
";",
"add_bb_to_loop",
"(",
"body",
"[",
"i",
"]",
",",
"loop_outer",
"(",
"loop",
")",
")",
";",
"}",
"free",
"(",
"body",
")",
";",
"while",
"(",
"loop",
"->",
"inner",
")",
"{",
"ploop",
"=",
"loop",
"->",
"inner",
";",
"flow_loop_tree_node_remove",
"(",
"ploop",
")",
";",
"flow_loop_tree_node_add",
"(",
"loop_outer",
"(",
"loop",
")",
",",
"ploop",
")",
";",
"}",
"delete_loop",
"(",
"loop",
")",
";",
"remove_edge",
"(",
"single_succ_edge",
"(",
"latch",
")",
")",
";",
"fix_bb_placements",
"(",
"latch",
",",
"&",
"dummy",
")",
";",
"}"
] | Remove the latch edge of a LOOP and update loops to indicate that
the LOOP was removed. | [
"Remove",
"the",
"latch",
"edge",
"of",
"a",
"LOOP",
"and",
"update",
"loops",
"to",
"indicate",
"that",
"the",
"LOOP",
"was",
"removed",
"."
] | [
"/* This is relatively straightforward. The dominators are unchanged, as\n loop header dominates loop latch, so the only thing we have to care of\n is the placement of loops and basic blocks inside the loop tree. We\n move them all to the loop->outer, and then let fix_bb_placements do\n its work. */",
"/* Remove the loop and free its data. */",
"/* We do not pass IRRED_INVALIDATED to fix_bb_placements here, as even if\n there is an irreducible region inside the cancelled loop, the flags will\n be still correct. */"
] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "irred_invalidated",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "irred_invalidated",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | fix_loop_placements | void | static void
fix_loop_placements (struct loop *loop, bool *irred_invalidated)
{
struct loop *outer;
while (loop_outer (loop))
{
outer = loop_outer (loop);
if (!fix_loop_placement (loop))
break;
/* Changing the placement of a loop in the loop tree may alter the
validity of condition 2) of the description of fix_bb_placement
for its preheader, because the successor is the header and belongs
to the loop. So call fix_bb_placements to fix up the placement
of the preheader and (possibly) of its predecessors. */
fix_bb_placements (loop_preheader_edge (loop)->src,
irred_invalidated);
loop = outer;
}
} | /* Fix placement of superloops of LOOP inside loop tree, i.e. ensure that
condition stated in description of fix_loop_placement holds for them.
It is used in case when we removed some edges coming out of LOOP, which
may cause the right placement of LOOP inside loop tree to change.
IRRED_INVALIDATED is set to true if a change in the loop structures might
invalidate the information about irreducible regions. */ | Fix placement of superloops of LOOP inside loop tree, i.e. ensure that
condition stated in description of fix_loop_placement holds for them.
It is used in case when we removed some edges coming out of LOOP, which
may cause the right placement of LOOP inside loop tree to change.
IRRED_INVALIDATED is set to true if a change in the loop structures might
invalidate the information about irreducible regions. | [
"Fix",
"placement",
"of",
"superloops",
"of",
"LOOP",
"inside",
"loop",
"tree",
"i",
".",
"e",
".",
"ensure",
"that",
"condition",
"stated",
"in",
"description",
"of",
"fix_loop_placement",
"holds",
"for",
"them",
".",
"It",
"is",
"used",
"in",
"case",
"when",
"we",
"removed",
"some",
"edges",
"coming",
"out",
"of",
"LOOP",
"which",
"may",
"cause",
"the",
"right",
"placement",
"of",
"LOOP",
"inside",
"loop",
"tree",
"to",
"change",
".",
"IRRED_INVALIDATED",
"is",
"set",
"to",
"true",
"if",
"a",
"change",
"in",
"the",
"loop",
"structures",
"might",
"invalidate",
"the",
"information",
"about",
"irreducible",
"regions",
"."
] | static void
fix_loop_placements (struct loop *loop, bool *irred_invalidated)
{
struct loop *outer;
while (loop_outer (loop))
{
outer = loop_outer (loop);
if (!fix_loop_placement (loop))
break;
fix_bb_placements (loop_preheader_edge (loop)->src,
irred_invalidated);
loop = outer;
}
} | [
"static",
"void",
"fix_loop_placements",
"(",
"struct",
"loop",
"*",
"loop",
",",
"bool",
"*",
"irred_invalidated",
")",
"{",
"struct",
"loop",
"*",
"outer",
";",
"while",
"(",
"loop_outer",
"(",
"loop",
")",
")",
"{",
"outer",
"=",
"loop_outer",
"(",
"loop",
")",
";",
"if",
"(",
"!",
"fix_loop_placement",
"(",
"loop",
")",
")",
"break",
";",
"fix_bb_placements",
"(",
"loop_preheader_edge",
"(",
"loop",
")",
"->",
"src",
",",
"irred_invalidated",
")",
";",
"loop",
"=",
"outer",
";",
"}",
"}"
] | Fix placement of superloops of LOOP inside loop tree, i.e. | [
"Fix",
"placement",
"of",
"superloops",
"of",
"LOOP",
"inside",
"loop",
"tree",
"i",
".",
"e",
"."
] | [
"/* Changing the placement of a loop in the loop tree may alter the\n\t validity of condition 2) of the description of fix_bb_placement\n\t for its preheader, because the successor is the header and belongs\n\t to the loop. So call fix_bb_placements to fix up the placement\n\t of the preheader and (possibly) of its predecessors. */"
] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "irred_invalidated",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "irred_invalidated",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | duplicate_loop | null | struct loop *
duplicate_loop (struct loop *loop, struct loop *target)
{
struct loop *cloop;
cloop = alloc_loop ();
place_new_loop (cloop);
/* Mark the new loop as copy of LOOP. */
set_loop_copy (loop, cloop);
/* Add it to target. */
flow_loop_tree_node_add (target, cloop);
return cloop;
} | /* Copies copy of LOOP as subloop of TARGET loop, placing newly
created loop into loops structure. */ | Copies copy of LOOP as subloop of TARGET loop, placing newly
created loop into loops structure. | [
"Copies",
"copy",
"of",
"LOOP",
"as",
"subloop",
"of",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loop",
"into",
"loops",
"structure",
"."
] | struct loop *
duplicate_loop (struct loop *loop, struct loop *target)
{
struct loop *cloop;
cloop = alloc_loop ();
place_new_loop (cloop);
set_loop_copy (loop, cloop);
flow_loop_tree_node_add (target, cloop);
return cloop;
} | [
"struct",
"loop",
"*",
"duplicate_loop",
"(",
"struct",
"loop",
"*",
"loop",
",",
"struct",
"loop",
"*",
"target",
")",
"{",
"struct",
"loop",
"*",
"cloop",
";",
"cloop",
"=",
"alloc_loop",
"(",
")",
";",
"place_new_loop",
"(",
"cloop",
")",
";",
"set_loop_copy",
"(",
"loop",
",",
"cloop",
")",
";",
"flow_loop_tree_node_add",
"(",
"target",
",",
"cloop",
")",
";",
"return",
"cloop",
";",
"}"
] | Copies copy of LOOP as subloop of TARGET loop, placing newly
created loop into loops structure. | [
"Copies",
"copy",
"of",
"LOOP",
"as",
"subloop",
"of",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loop",
"into",
"loops",
"structure",
"."
] | [
"/* Mark the new loop as copy of LOOP. */",
"/* Add it to target. */"
] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "target",
"type": "struct loop"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | duplicate_subloops | void | void
duplicate_subloops (struct loop *loop, struct loop *target)
{
struct loop *aloop, *cloop;
for (aloop = loop->inner; aloop; aloop = aloop->next)
{
cloop = duplicate_loop (aloop, target);
duplicate_subloops (aloop, cloop);
}
} | /* Copies structure of subloops of LOOP into TARGET loop, placing
newly created loops into loop tree. */ | Copies structure of subloops of LOOP into TARGET loop, placing
newly created loops into loop tree. | [
"Copies",
"structure",
"of",
"subloops",
"of",
"LOOP",
"into",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loops",
"into",
"loop",
"tree",
"."
] | void
duplicate_subloops (struct loop *loop, struct loop *target)
{
struct loop *aloop, *cloop;
for (aloop = loop->inner; aloop; aloop = aloop->next)
{
cloop = duplicate_loop (aloop, target);
duplicate_subloops (aloop, cloop);
}
} | [
"void",
"duplicate_subloops",
"(",
"struct",
"loop",
"*",
"loop",
",",
"struct",
"loop",
"*",
"target",
")",
"{",
"struct",
"loop",
"*",
"aloop",
",",
"*",
"cloop",
";",
"for",
"(",
"aloop",
"=",
"loop",
"->",
"inner",
";",
"aloop",
";",
"aloop",
"=",
"aloop",
"->",
"next",
")",
"{",
"cloop",
"=",
"duplicate_loop",
"(",
"aloop",
",",
"target",
")",
";",
"duplicate_subloops",
"(",
"aloop",
",",
"cloop",
")",
";",
"}",
"}"
] | Copies structure of subloops of LOOP into TARGET loop, placing
newly created loops into loop tree. | [
"Copies",
"structure",
"of",
"subloops",
"of",
"LOOP",
"into",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loops",
"into",
"loop",
"tree",
"."
] | [] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "target",
"type": "struct loop"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | copy_loops_to | void | static void
copy_loops_to (struct loop **copied_loops, int n, struct loop *target)
{
struct loop *aloop;
int i;
for (i = 0; i < n; i++)
{
aloop = duplicate_loop (copied_loops[i], target);
duplicate_subloops (copied_loops[i], aloop);
}
} | /* Copies structure of subloops of N loops, stored in array COPIED_LOOPS,
into TARGET loop, placing newly created loops into loop tree. */ | Copies structure of subloops of N loops, stored in array COPIED_LOOPS,
into TARGET loop, placing newly created loops into loop tree. | [
"Copies",
"structure",
"of",
"subloops",
"of",
"N",
"loops",
"stored",
"in",
"array",
"COPIED_LOOPS",
"into",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loops",
"into",
"loop",
"tree",
"."
] | static void
copy_loops_to (struct loop **copied_loops, int n, struct loop *target)
{
struct loop *aloop;
int i;
for (i = 0; i < n; i++)
{
aloop = duplicate_loop (copied_loops[i], target);
duplicate_subloops (copied_loops[i], aloop);
}
} | [
"static",
"void",
"copy_loops_to",
"(",
"struct",
"loop",
"*",
"*",
"copied_loops",
",",
"int",
"n",
",",
"struct",
"loop",
"*",
"target",
")",
"{",
"struct",
"loop",
"*",
"aloop",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"aloop",
"=",
"duplicate_loop",
"(",
"copied_loops",
"[",
"i",
"]",
",",
"target",
")",
";",
"duplicate_subloops",
"(",
"copied_loops",
"[",
"i",
"]",
",",
"aloop",
")",
";",
"}",
"}"
] | Copies structure of subloops of N loops, stored in array COPIED_LOOPS,
into TARGET loop, placing newly created loops into loop tree. | [
"Copies",
"structure",
"of",
"subloops",
"of",
"N",
"loops",
"stored",
"in",
"array",
"COPIED_LOOPS",
"into",
"TARGET",
"loop",
"placing",
"newly",
"created",
"loops",
"into",
"loop",
"tree",
"."
] | [] | [
{
"param": "copied_loops",
"type": "struct loop"
},
{
"param": "n",
"type": "int"
},
{
"param": "target",
"type": "struct loop"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "copied_loops",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | loop_redirect_edge | void | static void
loop_redirect_edge (edge e, basic_block dest)
{
if (e->dest == dest)
return;
redirect_edge_and_branch_force (e, dest);
} | /* Redirects edge E to basic block DEST. */ | Redirects edge E to basic block DEST. | [
"Redirects",
"edge",
"E",
"to",
"basic",
"block",
"DEST",
"."
] | static void
loop_redirect_edge (edge e, basic_block dest)
{
if (e->dest == dest)
return;
redirect_edge_and_branch_force (e, dest);
} | [
"static",
"void",
"loop_redirect_edge",
"(",
"edge",
"e",
",",
"basic_block",
"dest",
")",
"{",
"if",
"(",
"e",
"->",
"dest",
"==",
"dest",
")",
"return",
";",
"redirect_edge_and_branch_force",
"(",
"e",
",",
"dest",
")",
";",
"}"
] | Redirects edge E to basic block DEST. | [
"Redirects",
"edge",
"E",
"to",
"basic",
"block",
"DEST",
"."
] | [] | [
{
"param": "e",
"type": "edge"
},
{
"param": "dest",
"type": "basic_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "e",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dest",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | can_duplicate_loop_p | bool | bool
can_duplicate_loop_p (const struct loop *loop)
{
int ret;
basic_block *bbs = get_loop_body (loop);
ret = can_copy_bbs_p (bbs, loop->num_nodes);
free (bbs);
return ret;
} | /* Check whether LOOP's body can be duplicated. */ | Check whether LOOP's body can be duplicated. | [
"Check",
"whether",
"LOOP",
"'",
"s",
"body",
"can",
"be",
"duplicated",
"."
] | bool
can_duplicate_loop_p (const struct loop *loop)
{
int ret;
basic_block *bbs = get_loop_body (loop);
ret = can_copy_bbs_p (bbs, loop->num_nodes);
free (bbs);
return ret;
} | [
"bool",
"can_duplicate_loop_p",
"(",
"const",
"struct",
"loop",
"*",
"loop",
")",
"{",
"int",
"ret",
";",
"basic_block",
"*",
"bbs",
"=",
"get_loop_body",
"(",
"loop",
")",
";",
"ret",
"=",
"can_copy_bbs_p",
"(",
"bbs",
",",
"loop",
"->",
"num_nodes",
")",
";",
"free",
"(",
"bbs",
")",
";",
"return",
"ret",
";",
"}"
] | Check whether LOOP's body can be duplicated. | [
"Check",
"whether",
"LOOP",
"'",
"s",
"body",
"can",
"be",
"duplicated",
"."
] | [] | [
{
"param": "loop",
"type": "struct loop"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | has_preds_from_loop | bool | static bool
has_preds_from_loop (basic_block block, struct loop *loop)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, block->preds)
if (e->src->loop_father == loop)
return true;
return false;
} | /* True when a candidate preheader BLOCK has predecessors from LOOP. */ | True when a candidate preheader BLOCK has predecessors from LOOP. | [
"True",
"when",
"a",
"candidate",
"preheader",
"BLOCK",
"has",
"predecessors",
"from",
"LOOP",
"."
] | static bool
has_preds_from_loop (basic_block block, struct loop *loop)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, block->preds)
if (e->src->loop_father == loop)
return true;
return false;
} | [
"static",
"bool",
"has_preds_from_loop",
"(",
"basic_block",
"block",
",",
"struct",
"loop",
"*",
"loop",
")",
"{",
"edge",
"e",
";",
"edge_iterator",
"ei",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"block",
"->",
"preds",
")",
"",
"if",
"(",
"e",
"->",
"src",
"->",
"loop_father",
"==",
"loop",
")",
"return",
"true",
";",
"return",
"false",
";",
"}"
] | True when a candidate preheader BLOCK has predecessors from LOOP. | [
"True",
"when",
"a",
"candidate",
"preheader",
"BLOCK",
"has",
"predecessors",
"from",
"LOOP",
"."
] | [] | [
{
"param": "block",
"type": "basic_block"
},
{
"param": "loop",
"type": "struct loop"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "block",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | create_preheader | basic_block | basic_block
create_preheader (struct loop *loop, int flags)
{
edge e, fallthru;
basic_block dummy;
int nentry = 0;
bool irred = false;
bool latch_edge_was_fallthru;
edge one_succ_pred = NULL, single_entry = NULL;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, loop->header->preds)
{
if (e->src == loop->latch)
continue;
irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
nentry++;
single_entry = e;
if (single_succ_p (e->src))
one_succ_pred = e;
}
gcc_assert (nentry);
if (nentry == 1)
{
bool need_forwarder_block = false;
/* We do not allow entry block to be the loop preheader, since we
cannot emit code there. */
if (single_entry->src == ENTRY_BLOCK_PTR)
need_forwarder_block = true;
else
{
/* If we want simple preheaders, also force the preheader to have
just a single successor. */
if ((flags & CP_SIMPLE_PREHEADERS)
&& !single_succ_p (single_entry->src))
need_forwarder_block = true;
/* If we want fallthru preheaders, also create forwarder block when
preheader ends with a jump or has predecessors from loop. */
else if ((flags & CP_FALLTHRU_PREHEADERS)
&& (JUMP_P (BB_END (single_entry->src))
|| has_preds_from_loop (single_entry->src, loop)))
need_forwarder_block = true;
}
if (! need_forwarder_block)
return NULL;
}
mfb_kj_edge = loop_latch_edge (loop);
latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0;
fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL);
dummy = fallthru->src;
loop->header = fallthru->dest;
/* Try to be clever in placing the newly created preheader. The idea is to
avoid breaking any "fallthruness" relationship between blocks.
The preheader was created just before the header and all incoming edges
to the header were redirected to the preheader, except the latch edge.
So the only problematic case is when this latch edge was a fallthru
edge: it is not anymore after the preheader creation so we have broken
the fallthruness. We're therefore going to look for a better place. */
if (latch_edge_was_fallthru)
{
if (one_succ_pred)
e = one_succ_pred;
else
e = EDGE_PRED (dummy, 0);
move_block_after (dummy, e->src);
}
if (irred)
{
dummy->flags |= BB_IRREDUCIBLE_LOOP;
single_succ_edge (dummy)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
if (dump_file)
fprintf (dump_file, "Created preheader block for loop %i\n",
loop->num);
if (flags & CP_FALLTHRU_PREHEADERS)
gcc_assert ((single_succ_edge (dummy)->flags & EDGE_FALLTHRU)
&& !JUMP_P (BB_END (dummy)));
return dummy;
} | /* Creates a pre-header for a LOOP. Returns newly created block. Unless
CP_SIMPLE_PREHEADERS is set in FLAGS, we only force LOOP to have single
entry; otherwise we also force preheader block to have only one successor.
When CP_FALLTHRU_PREHEADERS is set in FLAGS, we force the preheader block
to be a fallthru predecessor to the loop header and to have only
predecessors from outside of the loop.
The function also updates dominators. */ | Creates a pre-header for a LOOP. Returns newly created block. Unless
CP_SIMPLE_PREHEADERS is set in FLAGS, we only force LOOP to have single
entry; otherwise we also force preheader block to have only one successor.
When CP_FALLTHRU_PREHEADERS is set in FLAGS, we force the preheader block
to be a fallthru predecessor to the loop header and to have only
predecessors from outside of the loop.
The function also updates dominators. | [
"Creates",
"a",
"pre",
"-",
"header",
"for",
"a",
"LOOP",
".",
"Returns",
"newly",
"created",
"block",
".",
"Unless",
"CP_SIMPLE_PREHEADERS",
"is",
"set",
"in",
"FLAGS",
"we",
"only",
"force",
"LOOP",
"to",
"have",
"single",
"entry",
";",
"otherwise",
"we",
"also",
"force",
"preheader",
"block",
"to",
"have",
"only",
"one",
"successor",
".",
"When",
"CP_FALLTHRU_PREHEADERS",
"is",
"set",
"in",
"FLAGS",
"we",
"force",
"the",
"preheader",
"block",
"to",
"be",
"a",
"fallthru",
"predecessor",
"to",
"the",
"loop",
"header",
"and",
"to",
"have",
"only",
"predecessors",
"from",
"outside",
"of",
"the",
"loop",
".",
"The",
"function",
"also",
"updates",
"dominators",
"."
] | basic_block
create_preheader (struct loop *loop, int flags)
{
edge e, fallthru;
basic_block dummy;
int nentry = 0;
bool irred = false;
bool latch_edge_was_fallthru;
edge one_succ_pred = NULL, single_entry = NULL;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, loop->header->preds)
{
if (e->src == loop->latch)
continue;
irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
nentry++;
single_entry = e;
if (single_succ_p (e->src))
one_succ_pred = e;
}
gcc_assert (nentry);
if (nentry == 1)
{
bool need_forwarder_block = false;
if (single_entry->src == ENTRY_BLOCK_PTR)
need_forwarder_block = true;
else
{
if ((flags & CP_SIMPLE_PREHEADERS)
&& !single_succ_p (single_entry->src))
need_forwarder_block = true;
else if ((flags & CP_FALLTHRU_PREHEADERS)
&& (JUMP_P (BB_END (single_entry->src))
|| has_preds_from_loop (single_entry->src, loop)))
need_forwarder_block = true;
}
if (! need_forwarder_block)
return NULL;
}
mfb_kj_edge = loop_latch_edge (loop);
latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0;
fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL);
dummy = fallthru->src;
loop->header = fallthru->dest;
if (latch_edge_was_fallthru)
{
if (one_succ_pred)
e = one_succ_pred;
else
e = EDGE_PRED (dummy, 0);
move_block_after (dummy, e->src);
}
if (irred)
{
dummy->flags |= BB_IRREDUCIBLE_LOOP;
single_succ_edge (dummy)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
if (dump_file)
fprintf (dump_file, "Created preheader block for loop %i\n",
loop->num);
if (flags & CP_FALLTHRU_PREHEADERS)
gcc_assert ((single_succ_edge (dummy)->flags & EDGE_FALLTHRU)
&& !JUMP_P (BB_END (dummy)));
return dummy;
} | [
"basic_block",
"create_preheader",
"(",
"struct",
"loop",
"*",
"loop",
",",
"int",
"flags",
")",
"{",
"edge",
"e",
",",
"fallthru",
";",
"basic_block",
"dummy",
";",
"int",
"nentry",
"=",
"0",
";",
"bool",
"irred",
"=",
"false",
";",
"bool",
"latch_edge_was_fallthru",
";",
"edge",
"one_succ_pred",
"=",
"NULL",
",",
"single_entry",
"=",
"NULL",
";",
"edge_iterator",
"ei",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"loop",
"->",
"header",
"->",
"preds",
")",
"",
"{",
"if",
"(",
"e",
"->",
"src",
"==",
"loop",
"->",
"latch",
")",
"continue",
";",
"irred",
"|=",
"(",
"e",
"->",
"flags",
"&",
"EDGE_IRREDUCIBLE_LOOP",
")",
"!=",
"0",
";",
"nentry",
"++",
";",
"single_entry",
"=",
"e",
";",
"if",
"(",
"single_succ_p",
"(",
"e",
"->",
"src",
")",
")",
"one_succ_pred",
"=",
"e",
";",
"}",
"gcc_assert",
"(",
"nentry",
")",
";",
"if",
"(",
"nentry",
"==",
"1",
")",
"{",
"bool",
"need_forwarder_block",
"=",
"false",
";",
"if",
"(",
"single_entry",
"->",
"src",
"==",
"ENTRY_BLOCK_PTR",
")",
"need_forwarder_block",
"=",
"true",
";",
"else",
"{",
"if",
"(",
"(",
"flags",
"&",
"CP_SIMPLE_PREHEADERS",
")",
"&&",
"!",
"single_succ_p",
"(",
"single_entry",
"->",
"src",
")",
")",
"need_forwarder_block",
"=",
"true",
";",
"else",
"if",
"(",
"(",
"flags",
"&",
"CP_FALLTHRU_PREHEADERS",
")",
"&&",
"(",
"JUMP_P",
"(",
"BB_END",
"(",
"single_entry",
"->",
"src",
")",
")",
"||",
"has_preds_from_loop",
"(",
"single_entry",
"->",
"src",
",",
"loop",
")",
")",
")",
"need_forwarder_block",
"=",
"true",
";",
"}",
"if",
"(",
"!",
"need_forwarder_block",
")",
"return",
"NULL",
";",
"}",
"mfb_kj_edge",
"=",
"loop_latch_edge",
"(",
"loop",
")",
";",
"latch_edge_was_fallthru",
"=",
"(",
"mfb_kj_edge",
"->",
"flags",
"&",
"EDGE_FALLTHRU",
")",
"!=",
"0",
";",
"fallthru",
"=",
"make_forwarder_block",
"(",
"loop",
"->",
"header",
",",
"mfb_keep_just",
",",
"NULL",
")",
";",
"dummy",
"=",
"fallthru",
"->",
"src",
";",
"loop",
"->",
"header",
"=",
"fallthru",
"->",
"dest",
";",
"if",
"(",
"latch_edge_was_fallthru",
")",
"{",
"if",
"(",
"one_succ_pred",
")",
"e",
"=",
"one_succ_pred",
";",
"else",
"e",
"=",
"EDGE_PRED",
"(",
"dummy",
",",
"0",
")",
";",
"move_block_after",
"(",
"dummy",
",",
"e",
"->",
"src",
")",
";",
"}",
"if",
"(",
"irred",
")",
"{",
"dummy",
"->",
"flags",
"|=",
"BB_IRREDUCIBLE_LOOP",
";",
"single_succ_edge",
"(",
"dummy",
")",
"->",
"flags",
"|=",
"EDGE_IRREDUCIBLE_LOOP",
";",
"}",
"if",
"(",
"dump_file",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"loop",
"->",
"num",
")",
";",
"if",
"(",
"flags",
"&",
"CP_FALLTHRU_PREHEADERS",
")",
"gcc_assert",
"(",
"(",
"single_succ_edge",
"(",
"dummy",
")",
"->",
"flags",
"&",
"EDGE_FALLTHRU",
")",
"&&",
"!",
"JUMP_P",
"(",
"BB_END",
"(",
"dummy",
")",
")",
")",
";",
"return",
"dummy",
";",
"}"
] | Creates a pre-header for a LOOP. | [
"Creates",
"a",
"pre",
"-",
"header",
"for",
"a",
"LOOP",
"."
] | [
"/* We do not allow entry block to be the loop preheader, since we\n\t cannot emit code there. */",
"/* If we want simple preheaders, also force the preheader to have\n just a single successor. */",
"/* If we want fallthru preheaders, also create forwarder block when\n preheader ends with a jump or has predecessors from loop. */",
"/* Try to be clever in placing the newly created preheader. The idea is to\n avoid breaking any \"fallthruness\" relationship between blocks.\n\n The preheader was created just before the header and all incoming edges\n to the header were redirected to the preheader, except the latch edge.\n So the only problematic case is when this latch edge was a fallthru\n edge: it is not anymore after the preheader creation so we have broken\n the fallthruness. We're therefore going to look for a better place. */"
] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "flags",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "flags",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | create_preheaders | void | void
create_preheaders (int flags)
{
loop_iterator li;
struct loop *loop;
if (!current_loops)
return;
FOR_EACH_LOOP (li, loop, 0)
create_preheader (loop, flags);
loops_state_set (LOOPS_HAVE_PREHEADERS);
} | /* Create preheaders for each loop; for meaning of FLAGS see create_preheader. */ | Create preheaders for each loop; for meaning of FLAGS see create_preheader. | [
"Create",
"preheaders",
"for",
"each",
"loop",
";",
"for",
"meaning",
"of",
"FLAGS",
"see",
"create_preheader",
"."
] | void
create_preheaders (int flags)
{
loop_iterator li;
struct loop *loop;
if (!current_loops)
return;
FOR_EACH_LOOP (li, loop, 0)
create_preheader (loop, flags);
loops_state_set (LOOPS_HAVE_PREHEADERS);
} | [
"void",
"create_preheaders",
"(",
"int",
"flags",
")",
"{",
"loop_iterator",
"li",
";",
"struct",
"loop",
"*",
"loop",
";",
"if",
"(",
"!",
"current_loops",
")",
"return",
";",
"FOR_EACH_LOOP",
"(",
"li",
",",
"loop",
",",
"0",
")",
"",
"create_preheader",
"(",
"loop",
",",
"flags",
")",
";",
"loops_state_set",
"(",
"LOOPS_HAVE_PREHEADERS",
")",
";",
"}"
] | Create preheaders for each loop; for meaning of FLAGS see create_preheader. | [
"Create",
"preheaders",
"for",
"each",
"loop",
";",
"for",
"meaning",
"of",
"FLAGS",
"see",
"create_preheader",
"."
] | [] | [
{
"param": "flags",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "flags",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | force_single_succ_latches | void | void
force_single_succ_latches (void)
{
loop_iterator li;
struct loop *loop;
edge e;
FOR_EACH_LOOP (li, loop, 0)
{
if (loop->latch != loop->header && single_succ_p (loop->latch))
continue;
e = find_edge (loop->latch, loop->header);
split_edge (e);
}
loops_state_set (LOOPS_HAVE_SIMPLE_LATCHES);
} | /* Forces all loop latches to have only single successor. */ | Forces all loop latches to have only single successor. | [
"Forces",
"all",
"loop",
"latches",
"to",
"have",
"only",
"single",
"successor",
"."
] | void
force_single_succ_latches (void)
{
loop_iterator li;
struct loop *loop;
edge e;
FOR_EACH_LOOP (li, loop, 0)
{
if (loop->latch != loop->header && single_succ_p (loop->latch))
continue;
e = find_edge (loop->latch, loop->header);
split_edge (e);
}
loops_state_set (LOOPS_HAVE_SIMPLE_LATCHES);
} | [
"void",
"force_single_succ_latches",
"(",
"void",
")",
"{",
"loop_iterator",
"li",
";",
"struct",
"loop",
"*",
"loop",
";",
"edge",
"e",
";",
"FOR_EACH_LOOP",
"(",
"li",
",",
"loop",
",",
"0",
")",
"",
"{",
"if",
"(",
"loop",
"->",
"latch",
"!=",
"loop",
"->",
"header",
"&&",
"single_succ_p",
"(",
"loop",
"->",
"latch",
")",
")",
"continue",
";",
"e",
"=",
"find_edge",
"(",
"loop",
"->",
"latch",
",",
"loop",
"->",
"header",
")",
";",
"split_edge",
"(",
"e",
")",
";",
"}",
"loops_state_set",
"(",
"LOOPS_HAVE_SIMPLE_LATCHES",
")",
";",
"}"
] | Forces all loop latches to have only single successor. | [
"Forces",
"all",
"loop",
"latches",
"to",
"have",
"only",
"single",
"successor",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | lv_adjust_loop_entry_edge | basic_block | static basic_block
lv_adjust_loop_entry_edge (basic_block first_head, basic_block second_head,
edge e, void *cond_expr, unsigned then_prob)
{
basic_block new_head = NULL;
edge e1;
gcc_assert (e->dest == second_head);
/* Split edge 'e'. This will create a new basic block, where we can
insert conditional expr. */
new_head = split_edge (e);
lv_add_condition_to_bb (first_head, second_head, new_head,
cond_expr);
/* Don't set EDGE_TRUE_VALUE in RTL mode, as it's invalid there. */
e = single_succ_edge (new_head);
e1 = make_edge (new_head, first_head,
current_ir_type () == IR_GIMPLE ? EDGE_TRUE_VALUE : 0);
e1->probability = then_prob;
e->probability = REG_BR_PROB_BASE - then_prob;
e1->count = RDIV (e->count * e1->probability, REG_BR_PROB_BASE);
e->count = RDIV (e->count * e->probability, REG_BR_PROB_BASE);
set_immediate_dominator (CDI_DOMINATORS, first_head, new_head);
set_immediate_dominator (CDI_DOMINATORS, second_head, new_head);
/* Adjust loop header phi nodes. */
lv_adjust_loop_header_phi (first_head, second_head, new_head, e1);
return new_head;
} | /* This function is called from loop_version. It splits the entry edge
of the loop we want to version, adds the versioning condition, and
adjust the edges to the two versions of the loop appropriately.
e is an incoming edge. Returns the basic block containing the
condition.
--- edge e ---- > [second_head]
Split it and insert new conditional expression and adjust edges.
--- edge e ---> [cond expr] ---> [first_head]
|
+---------> [second_head]
THEN_PROB is the probability of then branch of the condition. */ | This function is called from loop_version. It splits the entry edge
of the loop we want to version, adds the versioning condition, and
adjust the edges to the two versions of the loop appropriately.
e is an incoming edge. Returns the basic block containing the
condition.
edge e ---- > [second_head]
Split it and insert new conditional expression and adjust edges.
THEN_PROB is the probability of then branch of the condition. | [
"This",
"function",
"is",
"called",
"from",
"loop_version",
".",
"It",
"splits",
"the",
"entry",
"edge",
"of",
"the",
"loop",
"we",
"want",
"to",
"version",
"adds",
"the",
"versioning",
"condition",
"and",
"adjust",
"the",
"edges",
"to",
"the",
"two",
"versions",
"of",
"the",
"loop",
"appropriately",
".",
"e",
"is",
"an",
"incoming",
"edge",
".",
"Returns",
"the",
"basic",
"block",
"containing",
"the",
"condition",
".",
"edge",
"e",
"----",
">",
"[",
"second_head",
"]",
"Split",
"it",
"and",
"insert",
"new",
"conditional",
"expression",
"and",
"adjust",
"edges",
".",
"THEN_PROB",
"is",
"the",
"probability",
"of",
"then",
"branch",
"of",
"the",
"condition",
"."
] | static basic_block
lv_adjust_loop_entry_edge (basic_block first_head, basic_block second_head,
edge e, void *cond_expr, unsigned then_prob)
{
basic_block new_head = NULL;
edge e1;
gcc_assert (e->dest == second_head);
new_head = split_edge (e);
lv_add_condition_to_bb (first_head, second_head, new_head,
cond_expr);
e = single_succ_edge (new_head);
e1 = make_edge (new_head, first_head,
current_ir_type () == IR_GIMPLE ? EDGE_TRUE_VALUE : 0);
e1->probability = then_prob;
e->probability = REG_BR_PROB_BASE - then_prob;
e1->count = RDIV (e->count * e1->probability, REG_BR_PROB_BASE);
e->count = RDIV (e->count * e->probability, REG_BR_PROB_BASE);
set_immediate_dominator (CDI_DOMINATORS, first_head, new_head);
set_immediate_dominator (CDI_DOMINATORS, second_head, new_head);
lv_adjust_loop_header_phi (first_head, second_head, new_head, e1);
return new_head;
} | [
"static",
"basic_block",
"lv_adjust_loop_entry_edge",
"(",
"basic_block",
"first_head",
",",
"basic_block",
"second_head",
",",
"edge",
"e",
",",
"void",
"*",
"cond_expr",
",",
"unsigned",
"then_prob",
")",
"{",
"basic_block",
"new_head",
"=",
"NULL",
";",
"edge",
"e1",
";",
"gcc_assert",
"(",
"e",
"->",
"dest",
"==",
"second_head",
")",
";",
"new_head",
"=",
"split_edge",
"(",
"e",
")",
";",
"lv_add_condition_to_bb",
"(",
"first_head",
",",
"second_head",
",",
"new_head",
",",
"cond_expr",
")",
";",
"e",
"=",
"single_succ_edge",
"(",
"new_head",
")",
";",
"e1",
"=",
"make_edge",
"(",
"new_head",
",",
"first_head",
",",
"current_ir_type",
"(",
")",
"==",
"IR_GIMPLE",
"?",
"EDGE_TRUE_VALUE",
":",
"0",
")",
";",
"e1",
"->",
"probability",
"=",
"then_prob",
";",
"e",
"->",
"probability",
"=",
"REG_BR_PROB_BASE",
"-",
"then_prob",
";",
"e1",
"->",
"count",
"=",
"RDIV",
"(",
"e",
"->",
"count",
"*",
"e1",
"->",
"probability",
",",
"REG_BR_PROB_BASE",
")",
";",
"e",
"->",
"count",
"=",
"RDIV",
"(",
"e",
"->",
"count",
"*",
"e",
"->",
"probability",
",",
"REG_BR_PROB_BASE",
")",
";",
"set_immediate_dominator",
"(",
"CDI_DOMINATORS",
",",
"first_head",
",",
"new_head",
")",
";",
"set_immediate_dominator",
"(",
"CDI_DOMINATORS",
",",
"second_head",
",",
"new_head",
")",
";",
"lv_adjust_loop_header_phi",
"(",
"first_head",
",",
"second_head",
",",
"new_head",
",",
"e1",
")",
";",
"return",
"new_head",
";",
"}"
] | This function is called from loop_version. | [
"This",
"function",
"is",
"called",
"from",
"loop_version",
"."
] | [
"/* Split edge 'e'. This will create a new basic block, where we can\n insert conditional expr. */",
"/* Don't set EDGE_TRUE_VALUE in RTL mode, as it's invalid there. */",
"/* Adjust loop header phi nodes. */"
] | [
{
"param": "first_head",
"type": "basic_block"
},
{
"param": "second_head",
"type": "basic_block"
},
{
"param": "e",
"type": "edge"
},
{
"param": "cond_expr",
"type": "void"
},
{
"param": "then_prob",
"type": "unsigned"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "first_head",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "second_head",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "e",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cond_expr",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "then_prob",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
33bcf4b987279f500c834564b28145b7a5ccb102 | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/cfgloopmanip.c | [
"BSD-3-Clause"
] | C | loop_version | null | struct loop *
loop_version (struct loop *loop,
void *cond_expr, basic_block *condition_bb,
unsigned then_prob, unsigned then_scale, unsigned else_scale,
bool place_after)
{
basic_block first_head, second_head;
edge entry, latch_edge, true_edge, false_edge;
int irred_flag;
struct loop *nloop;
basic_block cond_bb;
/* Record entry and latch edges for the loop */
entry = loop_preheader_edge (loop);
irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
entry->flags &= ~EDGE_IRREDUCIBLE_LOOP;
/* Note down head of loop as first_head. */
first_head = entry->dest;
/* Duplicate loop. */
if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
NULL, NULL, NULL, 0))
{
entry->flags |= irred_flag;
return NULL;
}
/* After duplication entry edge now points to new loop head block.
Note down new head as second_head. */
second_head = entry->dest;
/* Split loop entry edge and insert new block with cond expr. */
cond_bb = lv_adjust_loop_entry_edge (first_head, second_head,
entry, cond_expr, then_prob);
if (condition_bb)
*condition_bb = cond_bb;
if (!cond_bb)
{
entry->flags |= irred_flag;
return NULL;
}
latch_edge = single_succ_edge (get_bb_copy (loop->latch));
extract_cond_bb_edges (cond_bb, &true_edge, &false_edge);
nloop = loopify (latch_edge,
single_pred_edge (get_bb_copy (loop->header)),
cond_bb, true_edge, false_edge,
false /* Do not redirect all edges. */,
then_scale, else_scale);
/* loopify redirected latch_edge. Update its PENDING_STMTS. */
lv_flush_pending_stmts (latch_edge);
/* loopify redirected condition_bb's succ edge. Update its PENDING_STMTS. */
extract_cond_bb_edges (cond_bb, &true_edge, &false_edge);
lv_flush_pending_stmts (false_edge);
/* Adjust irreducible flag. */
if (irred_flag)
{
cond_bb->flags |= BB_IRREDUCIBLE_LOOP;
loop_preheader_edge (loop)->flags |= EDGE_IRREDUCIBLE_LOOP;
loop_preheader_edge (nloop)->flags |= EDGE_IRREDUCIBLE_LOOP;
single_pred_edge (cond_bb)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
if (place_after)
{
basic_block *bbs = get_loop_body_in_dom_order (nloop), after;
unsigned i;
after = loop->latch;
for (i = 0; i < nloop->num_nodes; i++)
{
move_block_after (bbs[i], after);
after = bbs[i];
}
free (bbs);
}
/* At this point condition_bb is loop preheader with two successors,
first_head and second_head. Make sure that loop preheader has only
one successor. */
split_edge (loop_preheader_edge (loop));
split_edge (loop_preheader_edge (nloop));
return nloop;
} | /* Main entry point for Loop Versioning transformation.
This transformation given a condition and a loop, creates
-if (condition) { loop_copy1 } else { loop_copy2 },
where loop_copy1 is the loop transformed in one way, and loop_copy2
is the loop transformed in another way (or unchanged). 'condition'
may be a run time test for things that were not resolved by static
analysis (overlapping ranges (anti-aliasing), alignment, etc.).
THEN_PROB is the probability of the then edge of the if. THEN_SCALE
is the ratio by that the frequencies in the original loop should
be scaled. ELSE_SCALE is the ratio by that the frequencies in the
new loop should be scaled.
If PLACE_AFTER is true, we place the new loop after LOOP in the
instruction stream, otherwise it is placed before LOOP. */ | Main entry point for Loop Versioning transformation.
This transformation given a condition and a loop, creates
if (condition) { loop_copy1 } else { loop_copy2 },
where loop_copy1 is the loop transformed in one way, and loop_copy2
is the loop transformed in another way (or unchanged). 'condition'
may be a run time test for things that were not resolved by static
analysis (overlapping ranges (anti-aliasing), alignment, etc.).
THEN_PROB is the probability of the then edge of the if. THEN_SCALE
is the ratio by that the frequencies in the original loop should
be scaled. ELSE_SCALE is the ratio by that the frequencies in the
new loop should be scaled.
If PLACE_AFTER is true, we place the new loop after LOOP in the
instruction stream, otherwise it is placed before LOOP. | [
"Main",
"entry",
"point",
"for",
"Loop",
"Versioning",
"transformation",
".",
"This",
"transformation",
"given",
"a",
"condition",
"and",
"a",
"loop",
"creates",
"if",
"(",
"condition",
")",
"{",
"loop_copy1",
"}",
"else",
"{",
"loop_copy2",
"}",
"where",
"loop_copy1",
"is",
"the",
"loop",
"transformed",
"in",
"one",
"way",
"and",
"loop_copy2",
"is",
"the",
"loop",
"transformed",
"in",
"another",
"way",
"(",
"or",
"unchanged",
")",
".",
"'",
"condition",
"'",
"may",
"be",
"a",
"run",
"time",
"test",
"for",
"things",
"that",
"were",
"not",
"resolved",
"by",
"static",
"analysis",
"(",
"overlapping",
"ranges",
"(",
"anti",
"-",
"aliasing",
")",
"alignment",
"etc",
".",
")",
".",
"THEN_PROB",
"is",
"the",
"probability",
"of",
"the",
"then",
"edge",
"of",
"the",
"if",
".",
"THEN_SCALE",
"is",
"the",
"ratio",
"by",
"that",
"the",
"frequencies",
"in",
"the",
"original",
"loop",
"should",
"be",
"scaled",
".",
"ELSE_SCALE",
"is",
"the",
"ratio",
"by",
"that",
"the",
"frequencies",
"in",
"the",
"new",
"loop",
"should",
"be",
"scaled",
".",
"If",
"PLACE_AFTER",
"is",
"true",
"we",
"place",
"the",
"new",
"loop",
"after",
"LOOP",
"in",
"the",
"instruction",
"stream",
"otherwise",
"it",
"is",
"placed",
"before",
"LOOP",
"."
] | struct loop *
loop_version (struct loop *loop,
void *cond_expr, basic_block *condition_bb,
unsigned then_prob, unsigned then_scale, unsigned else_scale,
bool place_after)
{
basic_block first_head, second_head;
edge entry, latch_edge, true_edge, false_edge;
int irred_flag;
struct loop *nloop;
basic_block cond_bb;
entry = loop_preheader_edge (loop);
irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
entry->flags &= ~EDGE_IRREDUCIBLE_LOOP;
first_head = entry->dest;
if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
NULL, NULL, NULL, 0))
{
entry->flags |= irred_flag;
return NULL;
}
second_head = entry->dest;
cond_bb = lv_adjust_loop_entry_edge (first_head, second_head,
entry, cond_expr, then_prob);
if (condition_bb)
*condition_bb = cond_bb;
if (!cond_bb)
{
entry->flags |= irred_flag;
return NULL;
}
latch_edge = single_succ_edge (get_bb_copy (loop->latch));
extract_cond_bb_edges (cond_bb, &true_edge, &false_edge);
nloop = loopify (latch_edge,
single_pred_edge (get_bb_copy (loop->header)),
cond_bb, true_edge, false_edge,
false ,
then_scale, else_scale);
lv_flush_pending_stmts (latch_edge);
extract_cond_bb_edges (cond_bb, &true_edge, &false_edge);
lv_flush_pending_stmts (false_edge);
if (irred_flag)
{
cond_bb->flags |= BB_IRREDUCIBLE_LOOP;
loop_preheader_edge (loop)->flags |= EDGE_IRREDUCIBLE_LOOP;
loop_preheader_edge (nloop)->flags |= EDGE_IRREDUCIBLE_LOOP;
single_pred_edge (cond_bb)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
if (place_after)
{
basic_block *bbs = get_loop_body_in_dom_order (nloop), after;
unsigned i;
after = loop->latch;
for (i = 0; i < nloop->num_nodes; i++)
{
move_block_after (bbs[i], after);
after = bbs[i];
}
free (bbs);
}
split_edge (loop_preheader_edge (loop));
split_edge (loop_preheader_edge (nloop));
return nloop;
} | [
"struct",
"loop",
"*",
"loop_version",
"(",
"struct",
"loop",
"*",
"loop",
",",
"void",
"*",
"cond_expr",
",",
"basic_block",
"*",
"condition_bb",
",",
"unsigned",
"then_prob",
",",
"unsigned",
"then_scale",
",",
"unsigned",
"else_scale",
",",
"bool",
"place_after",
")",
"{",
"basic_block",
"first_head",
",",
"second_head",
";",
"edge",
"entry",
",",
"latch_edge",
",",
"true_edge",
",",
"false_edge",
";",
"int",
"irred_flag",
";",
"struct",
"loop",
"*",
"nloop",
";",
"basic_block",
"cond_bb",
";",
"entry",
"=",
"loop_preheader_edge",
"(",
"loop",
")",
";",
"irred_flag",
"=",
"entry",
"->",
"flags",
"&",
"EDGE_IRREDUCIBLE_LOOP",
";",
"entry",
"->",
"flags",
"&=",
"~",
"EDGE_IRREDUCIBLE_LOOP",
";",
"first_head",
"=",
"entry",
"->",
"dest",
";",
"if",
"(",
"!",
"cfg_hook_duplicate_loop_to_header_edge",
"(",
"loop",
",",
"entry",
",",
"1",
",",
"NULL",
",",
"NULL",
",",
"NULL",
",",
"0",
")",
")",
"{",
"entry",
"->",
"flags",
"|=",
"irred_flag",
";",
"return",
"NULL",
";",
"}",
"second_head",
"=",
"entry",
"->",
"dest",
";",
"cond_bb",
"=",
"lv_adjust_loop_entry_edge",
"(",
"first_head",
",",
"second_head",
",",
"entry",
",",
"cond_expr",
",",
"then_prob",
")",
";",
"if",
"(",
"condition_bb",
")",
"*",
"condition_bb",
"=",
"cond_bb",
";",
"if",
"(",
"!",
"cond_bb",
")",
"{",
"entry",
"->",
"flags",
"|=",
"irred_flag",
";",
"return",
"NULL",
";",
"}",
"latch_edge",
"=",
"single_succ_edge",
"(",
"get_bb_copy",
"(",
"loop",
"->",
"latch",
")",
")",
";",
"extract_cond_bb_edges",
"(",
"cond_bb",
",",
"&",
"true_edge",
",",
"&",
"false_edge",
")",
";",
"nloop",
"=",
"loopify",
"(",
"latch_edge",
",",
"single_pred_edge",
"(",
"get_bb_copy",
"(",
"loop",
"->",
"header",
")",
")",
",",
"cond_bb",
",",
"true_edge",
",",
"false_edge",
",",
"false",
",",
"then_scale",
",",
"else_scale",
")",
";",
"lv_flush_pending_stmts",
"(",
"latch_edge",
")",
";",
"extract_cond_bb_edges",
"(",
"cond_bb",
",",
"&",
"true_edge",
",",
"&",
"false_edge",
")",
";",
"lv_flush_pending_stmts",
"(",
"false_edge",
")",
";",
"if",
"(",
"irred_flag",
")",
"{",
"cond_bb",
"->",
"flags",
"|=",
"BB_IRREDUCIBLE_LOOP",
";",
"loop_preheader_edge",
"(",
"loop",
")",
"->",
"flags",
"|=",
"EDGE_IRREDUCIBLE_LOOP",
";",
"loop_preheader_edge",
"(",
"nloop",
")",
"->",
"flags",
"|=",
"EDGE_IRREDUCIBLE_LOOP",
";",
"single_pred_edge",
"(",
"cond_bb",
")",
"->",
"flags",
"|=",
"EDGE_IRREDUCIBLE_LOOP",
";",
"}",
"if",
"(",
"place_after",
")",
"{",
"basic_block",
"*",
"bbs",
"=",
"get_loop_body_in_dom_order",
"(",
"nloop",
")",
",",
"after",
";",
"unsigned",
"i",
";",
"after",
"=",
"loop",
"->",
"latch",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"nloop",
"->",
"num_nodes",
";",
"i",
"++",
")",
"{",
"move_block_after",
"(",
"bbs",
"[",
"i",
"]",
",",
"after",
")",
";",
"after",
"=",
"bbs",
"[",
"i",
"]",
";",
"}",
"free",
"(",
"bbs",
")",
";",
"}",
"split_edge",
"(",
"loop_preheader_edge",
"(",
"loop",
")",
")",
";",
"split_edge",
"(",
"loop_preheader_edge",
"(",
"nloop",
")",
")",
";",
"return",
"nloop",
";",
"}"
] | Main entry point for Loop Versioning transformation. | [
"Main",
"entry",
"point",
"for",
"Loop",
"Versioning",
"transformation",
"."
] | [
"/* Record entry and latch edges for the loop */",
"/* Note down head of loop as first_head. */",
"/* Duplicate loop. */",
"/* After duplication entry edge now points to new loop head block.\n Note down new head as second_head. */",
"/* Split loop entry edge and insert new block with cond expr. */",
"/* Do not redirect all edges. */",
"/* loopify redirected latch_edge. Update its PENDING_STMTS. */",
"/* loopify redirected condition_bb's succ edge. Update its PENDING_STMTS. */",
"/* Adjust irreducible flag. */",
"/* At this point condition_bb is loop preheader with two successors,\n first_head and second_head. Make sure that loop preheader has only\n one successor. */"
] | [
{
"param": "loop",
"type": "struct loop"
},
{
"param": "cond_expr",
"type": "void"
},
{
"param": "condition_bb",
"type": "basic_block"
},
{
"param": "then_prob",
"type": "unsigned"
},
{
"param": "then_scale",
"type": "unsigned"
},
{
"param": "else_scale",
"type": "unsigned"
},
{
"param": "place_after",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "struct loop",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cond_expr",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "condition_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "then_prob",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "then_scale",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "else_scale",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "place_after",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a72f2fae7e1af1ee02d7750952ed3ab35fea9d04 | atrens/DragonFlyBSD-src | contrib/wpa_supplicant/wpa_supplicant/events.c | [
"BSD-3-Clause"
] | C | wpa_supplicant_scard_init | int | int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
#ifdef IEEE8021X_EAPOL
#ifdef PCSC_FUNCS
int aka = 0, sim = 0;
if (ssid->eap.pcsc == NULL || wpa_s->scard != NULL ||
wpa_s->conf->external_sim)
return 0;
if (ssid->eap.eap_methods == NULL) {
sim = 1;
aka = 1;
} else {
struct eap_method_type *eap = ssid->eap.eap_methods;
while (eap->vendor != EAP_VENDOR_IETF ||
eap->method != EAP_TYPE_NONE) {
if (eap->vendor == EAP_VENDOR_IETF) {
if (eap->method == EAP_TYPE_SIM)
sim = 1;
else if (eap->method == EAP_TYPE_AKA ||
eap->method == EAP_TYPE_AKA_PRIME)
aka = 1;
}
eap++;
}
}
if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_SIM) == NULL)
sim = 0;
if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_AKA) == NULL &&
eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_AKA_PRIME) ==
NULL)
aka = 0;
if (!sim && !aka) {
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to "
"use SIM, but neither EAP-SIM nor EAP-AKA are "
"enabled");
return 0;
}
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to use SIM "
"(sim=%d aka=%d) - initialize PCSC", sim, aka);
wpa_s->scard = scard_init(NULL);
if (wpa_s->scard == NULL) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initialize SIM "
"(pcsc-lite)");
return -1;
}
wpa_sm_set_scard_ctx(wpa_s->wpa, wpa_s->scard);
eapol_sm_register_scard_ctx(wpa_s->eapol, wpa_s->scard);
#endif /* PCSC_FUNCS */
#endif /* IEEE8021X_EAPOL */
return 0;
} | /**
* wpa_supplicant_scard_init - Initialize SIM/USIM access with PC/SC
* @wpa_s: pointer to wpa_supplicant data
* @ssid: Configuration data for the network
* Returns: 0 on success, -1 on failure
*
* This function is called when starting authentication with a network that is
* configured to use PC/SC for SIM/USIM access (EAP-SIM or EAP-AKA).
*/ | Initialize SIM/USIM access with PC/SC
@wpa_s: pointer to wpa_supplicant data
@ssid: Configuration data for the network
Returns: 0 on success, -1 on failure
This function is called when starting authentication with a network that is
configured to use PC/SC for SIM/USIM access (EAP-SIM or EAP-AKA). | [
"Initialize",
"SIM",
"/",
"USIM",
"access",
"with",
"PC",
"/",
"SC",
"@wpa_s",
":",
"pointer",
"to",
"wpa_supplicant",
"data",
"@ssid",
":",
"Configuration",
"data",
"for",
"the",
"network",
"Returns",
":",
"0",
"on",
"success",
"-",
"1",
"on",
"failure",
"This",
"function",
"is",
"called",
"when",
"starting",
"authentication",
"with",
"a",
"network",
"that",
"is",
"configured",
"to",
"use",
"PC",
"/",
"SC",
"for",
"SIM",
"/",
"USIM",
"access",
"(",
"EAP",
"-",
"SIM",
"or",
"EAP",
"-",
"AKA",
")",
"."
] | int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
#ifdef IEEE8021X_EAPOL
#ifdef PCSC_FUNCS
int aka = 0, sim = 0;
if (ssid->eap.pcsc == NULL || wpa_s->scard != NULL ||
wpa_s->conf->external_sim)
return 0;
if (ssid->eap.eap_methods == NULL) {
sim = 1;
aka = 1;
} else {
struct eap_method_type *eap = ssid->eap.eap_methods;
while (eap->vendor != EAP_VENDOR_IETF ||
eap->method != EAP_TYPE_NONE) {
if (eap->vendor == EAP_VENDOR_IETF) {
if (eap->method == EAP_TYPE_SIM)
sim = 1;
else if (eap->method == EAP_TYPE_AKA ||
eap->method == EAP_TYPE_AKA_PRIME)
aka = 1;
}
eap++;
}
}
if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_SIM) == NULL)
sim = 0;
if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_AKA) == NULL &&
eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_AKA_PRIME) ==
NULL)
aka = 0;
if (!sim && !aka) {
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to "
"use SIM, but neither EAP-SIM nor EAP-AKA are "
"enabled");
return 0;
}
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to use SIM "
"(sim=%d aka=%d) - initialize PCSC", sim, aka);
wpa_s->scard = scard_init(NULL);
if (wpa_s->scard == NULL) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initialize SIM "
"(pcsc-lite)");
return -1;
}
wpa_sm_set_scard_ctx(wpa_s->wpa, wpa_s->scard);
eapol_sm_register_scard_ctx(wpa_s->eapol, wpa_s->scard);
#endif
#endif
return 0;
} | [
"int",
"wpa_supplicant_scard_init",
"(",
"struct",
"wpa_supplicant",
"*",
"wpa_s",
",",
"struct",
"wpa_ssid",
"*",
"ssid",
")",
"{",
"#ifdef",
"IEEE8021X_EAPOL",
"#ifdef",
"PCSC_FUNCS",
"int",
"aka",
"=",
"0",
",",
"sim",
"=",
"0",
";",
"if",
"(",
"ssid",
"->",
"eap",
".",
"pcsc",
"==",
"NULL",
"||",
"wpa_s",
"->",
"scard",
"!=",
"NULL",
"||",
"wpa_s",
"->",
"conf",
"->",
"external_sim",
")",
"return",
"0",
";",
"if",
"(",
"ssid",
"->",
"eap",
".",
"eap_methods",
"==",
"NULL",
")",
"{",
"sim",
"=",
"1",
";",
"aka",
"=",
"1",
";",
"}",
"else",
"{",
"struct",
"eap_method_type",
"*",
"eap",
"=",
"ssid",
"->",
"eap",
".",
"eap_methods",
";",
"while",
"(",
"eap",
"->",
"vendor",
"!=",
"EAP_VENDOR_IETF",
"||",
"eap",
"->",
"method",
"!=",
"EAP_TYPE_NONE",
")",
"{",
"if",
"(",
"eap",
"->",
"vendor",
"==",
"EAP_VENDOR_IETF",
")",
"{",
"if",
"(",
"eap",
"->",
"method",
"==",
"EAP_TYPE_SIM",
")",
"sim",
"=",
"1",
";",
"else",
"if",
"(",
"eap",
"->",
"method",
"==",
"EAP_TYPE_AKA",
"||",
"eap",
"->",
"method",
"==",
"EAP_TYPE_AKA_PRIME",
")",
"aka",
"=",
"1",
";",
"}",
"eap",
"++",
";",
"}",
"}",
"if",
"(",
"eap_peer_get_eap_method",
"(",
"EAP_VENDOR_IETF",
",",
"EAP_TYPE_SIM",
")",
"==",
"NULL",
")",
"sim",
"=",
"0",
";",
"if",
"(",
"eap_peer_get_eap_method",
"(",
"EAP_VENDOR_IETF",
",",
"EAP_TYPE_AKA",
")",
"==",
"NULL",
"&&",
"eap_peer_get_eap_method",
"(",
"EAP_VENDOR_IETF",
",",
"EAP_TYPE_AKA_PRIME",
")",
"==",
"NULL",
")",
"aka",
"=",
"0",
";",
"if",
"(",
"!",
"sim",
"&&",
"!",
"aka",
")",
"{",
"wpa_dbg",
"(",
"wpa_s",
",",
"MSG_DEBUG",
",",
"\"",
"\"",
"\"",
"\"",
"\"",
"\"",
")",
";",
"return",
"0",
";",
"}",
"wpa_dbg",
"(",
"wpa_s",
",",
"MSG_DEBUG",
",",
"\"",
"\"",
"\"",
"\"",
",",
"sim",
",",
"aka",
")",
";",
"wpa_s",
"->",
"scard",
"=",
"scard_init",
"(",
"NULL",
")",
";",
"if",
"(",
"wpa_s",
"->",
"scard",
"==",
"NULL",
")",
"{",
"wpa_msg",
"(",
"wpa_s",
",",
"MSG_WARNING",
",",
"\"",
"\"",
"\"",
"\"",
")",
";",
"return",
"-1",
";",
"}",
"wpa_sm_set_scard_ctx",
"(",
"wpa_s",
"->",
"wpa",
",",
"wpa_s",
"->",
"scard",
")",
";",
"eapol_sm_register_scard_ctx",
"(",
"wpa_s",
"->",
"eapol",
",",
"wpa_s",
"->",
"scard",
")",
";",
"#endif",
"#endif",
"return",
"0",
";",
"}"
] | wpa_supplicant_scard_init - Initialize SIM/USIM access with PC/SC
@wpa_s: pointer to wpa_supplicant data
@ssid: Configuration data for the network
Returns: 0 on success, -1 on failure | [
"wpa_supplicant_scard_init",
"-",
"Initialize",
"SIM",
"/",
"USIM",
"access",
"with",
"PC",
"/",
"SC",
"@wpa_s",
":",
"pointer",
"to",
"wpa_supplicant",
"data",
"@ssid",
":",
"Configuration",
"data",
"for",
"the",
"network",
"Returns",
":",
"0",
"on",
"success",
"-",
"1",
"on",
"failure"
] | [
"/* PCSC_FUNCS */",
"/* IEEE8021X_EAPOL */"
] | [
{
"param": "wpa_s",
"type": "struct wpa_supplicant"
},
{
"param": "ssid",
"type": "struct wpa_ssid"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "wpa_s",
"type": "struct wpa_supplicant",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ssid",
"type": "struct wpa_ssid",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a72f2fae7e1af1ee02d7750952ed3ab35fea9d04 | atrens/DragonFlyBSD-src | contrib/wpa_supplicant/wpa_supplicant/events.c | [
"BSD-3-Clause"
] | C | bss_is_ess | int | static int bss_is_ess(struct wpa_bss *bss)
{
if (bss_is_dmg(bss)) {
return (bss->caps & IEEE80211_CAP_DMG_MASK) ==
IEEE80211_CAP_DMG_AP;
}
return ((bss->caps & (IEEE80211_CAP_ESS | IEEE80211_CAP_IBSS)) ==
IEEE80211_CAP_ESS);
} | /*
* Test whether BSS is in an ESS.
* This is done differently in DMG (60 GHz) and non-DMG bands
*/ | Test whether BSS is in an ESS.
This is done differently in DMG (60 GHz) and non-DMG bands | [
"Test",
"whether",
"BSS",
"is",
"in",
"an",
"ESS",
".",
"This",
"is",
"done",
"differently",
"in",
"DMG",
"(",
"60",
"GHz",
")",
"and",
"non",
"-",
"DMG",
"bands"
] | static int bss_is_ess(struct wpa_bss *bss)
{
if (bss_is_dmg(bss)) {
return (bss->caps & IEEE80211_CAP_DMG_MASK) ==
IEEE80211_CAP_DMG_AP;
}
return ((bss->caps & (IEEE80211_CAP_ESS | IEEE80211_CAP_IBSS)) ==
IEEE80211_CAP_ESS);
} | [
"static",
"int",
"bss_is_ess",
"(",
"struct",
"wpa_bss",
"*",
"bss",
")",
"{",
"if",
"(",
"bss_is_dmg",
"(",
"bss",
")",
")",
"{",
"return",
"(",
"bss",
"->",
"caps",
"&",
"IEEE80211_CAP_DMG_MASK",
")",
"==",
"IEEE80211_CAP_DMG_AP",
";",
"}",
"return",
"(",
"(",
"bss",
"->",
"caps",
"&",
"(",
"IEEE80211_CAP_ESS",
"|",
"IEEE80211_CAP_IBSS",
")",
")",
"==",
"IEEE80211_CAP_ESS",
")",
";",
"}"
] | Test whether BSS is in an ESS. | [
"Test",
"whether",
"BSS",
"is",
"in",
"an",
"ESS",
"."
] | [] | [
{
"param": "bss",
"type": "struct wpa_bss"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bss",
"type": "struct wpa_bss",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_append_data | void | static void
lto_append_data (const char *chars, unsigned int num_chars, void *opaque)
{
gcc_assert (opaque == NULL);
lang_hooks.lto.append_data (chars, num_chars, opaque);
} | /* Flush compressed stream data function, sends NUM_CHARS from CHARS
to the append lang hook, OPAQUE is currently always NULL. */ | Flush compressed stream data function, sends NUM_CHARS from CHARS
to the append lang hook, OPAQUE is currently always NULL. | [
"Flush",
"compressed",
"stream",
"data",
"function",
"sends",
"NUM_CHARS",
"from",
"CHARS",
"to",
"the",
"append",
"lang",
"hook",
"OPAQUE",
"is",
"currently",
"always",
"NULL",
"."
] | static void
lto_append_data (const char *chars, unsigned int num_chars, void *opaque)
{
gcc_assert (opaque == NULL);
lang_hooks.lto.append_data (chars, num_chars, opaque);
} | [
"static",
"void",
"lto_append_data",
"(",
"const",
"char",
"*",
"chars",
",",
"unsigned",
"int",
"num_chars",
",",
"void",
"*",
"opaque",
")",
"{",
"gcc_assert",
"(",
"opaque",
"==",
"NULL",
")",
";",
"lang_hooks",
".",
"lto",
".",
"append_data",
"(",
"chars",
",",
"num_chars",
",",
"opaque",
")",
";",
"}"
] | Flush compressed stream data function, sends NUM_CHARS from CHARS
to the append lang hook, OPAQUE is currently always NULL. | [
"Flush",
"compressed",
"stream",
"data",
"function",
"sends",
"NUM_CHARS",
"from",
"CHARS",
"to",
"the",
"append",
"lang",
"hook",
"OPAQUE",
"is",
"currently",
"always",
"NULL",
"."
] | [] | [
{
"param": "chars",
"type": "char"
},
{
"param": "num_chars",
"type": "unsigned int"
},
{
"param": "opaque",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "chars",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "num_chars",
"type": "unsigned int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "opaque",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_begin_section | void | void
lto_begin_section (const char *name, bool compress)
{
lang_hooks.lto.begin_section (name);
gcc_assert (compression_stream == NULL);
if (compress)
compression_stream = lto_start_compression (lto_append_data, NULL);
} | /* Begin a new output section named NAME. If COMPRESS is true, zlib compress
the section. */ | Begin a new output section named NAME. If COMPRESS is true, zlib compress
the section. | [
"Begin",
"a",
"new",
"output",
"section",
"named",
"NAME",
".",
"If",
"COMPRESS",
"is",
"true",
"zlib",
"compress",
"the",
"section",
"."
] | void
lto_begin_section (const char *name, bool compress)
{
lang_hooks.lto.begin_section (name);
gcc_assert (compression_stream == NULL);
if (compress)
compression_stream = lto_start_compression (lto_append_data, NULL);
} | [
"void",
"lto_begin_section",
"(",
"const",
"char",
"*",
"name",
",",
"bool",
"compress",
")",
"{",
"lang_hooks",
".",
"lto",
".",
"begin_section",
"(",
"name",
")",
";",
"gcc_assert",
"(",
"compression_stream",
"==",
"NULL",
")",
";",
"if",
"(",
"compress",
")",
"compression_stream",
"=",
"lto_start_compression",
"(",
"lto_append_data",
",",
"NULL",
")",
";",
"}"
] | Begin a new output section named NAME. | [
"Begin",
"a",
"new",
"output",
"section",
"named",
"NAME",
"."
] | [] | [
{
"param": "name",
"type": "char"
},
{
"param": "compress",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "compress",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_end_section | void | void
lto_end_section (void)
{
if (compression_stream)
{
lto_end_compression (compression_stream);
compression_stream = NULL;
}
lang_hooks.lto.end_section ();
} | /* End the current output section. */ | End the current output section. | [
"End",
"the",
"current",
"output",
"section",
"."
] | void
lto_end_section (void)
{
if (compression_stream)
{
lto_end_compression (compression_stream);
compression_stream = NULL;
}
lang_hooks.lto.end_section ();
} | [
"void",
"lto_end_section",
"(",
"void",
")",
"{",
"if",
"(",
"compression_stream",
")",
"{",
"lto_end_compression",
"(",
"compression_stream",
")",
";",
"compression_stream",
"=",
"NULL",
";",
"}",
"lang_hooks",
".",
"lto",
".",
"end_section",
"(",
")",
";",
"}"
] | End the current output section. | [
"End",
"the",
"current",
"output",
"section",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_write_data | void | void
lto_write_data (const void *data, unsigned int size)
{
if (compression_stream)
lto_compress_block (compression_stream, (const char *)data, size);
else
lang_hooks.lto.append_data ((const char *)data, size, NULL);
} | /* Write SIZE bytes starting at DATA to the assembler. */ | Write SIZE bytes starting at DATA to the assembler. | [
"Write",
"SIZE",
"bytes",
"starting",
"at",
"DATA",
"to",
"the",
"assembler",
"."
] | void
lto_write_data (const void *data, unsigned int size)
{
if (compression_stream)
lto_compress_block (compression_stream, (const char *)data, size);
else
lang_hooks.lto.append_data ((const char *)data, size, NULL);
} | [
"void",
"lto_write_data",
"(",
"const",
"void",
"*",
"data",
",",
"unsigned",
"int",
"size",
")",
"{",
"if",
"(",
"compression_stream",
")",
"lto_compress_block",
"(",
"compression_stream",
",",
"(",
"const",
"char",
"*",
")",
"data",
",",
"size",
")",
";",
"else",
"lang_hooks",
".",
"lto",
".",
"append_data",
"(",
"(",
"const",
"char",
"*",
")",
"data",
",",
"size",
",",
"NULL",
")",
";",
"}"
] | Write SIZE bytes starting at DATA to the assembler. | [
"Write",
"SIZE",
"bytes",
"starting",
"at",
"DATA",
"to",
"the",
"assembler",
"."
] | [] | [
{
"param": "data",
"type": "void"
},
{
"param": "size",
"type": "unsigned int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "size",
"type": "unsigned int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_write_raw_data | void | void
lto_write_raw_data (const void *data, unsigned int size)
{
lang_hooks.lto.append_data ((const char *)data, size, NULL);
} | /* Write SIZE bytes starting at DATA to the assembler. */ | Write SIZE bytes starting at DATA to the assembler. | [
"Write",
"SIZE",
"bytes",
"starting",
"at",
"DATA",
"to",
"the",
"assembler",
"."
] | void
lto_write_raw_data (const void *data, unsigned int size)
{
lang_hooks.lto.append_data ((const char *)data, size, NULL);
} | [
"void",
"lto_write_raw_data",
"(",
"const",
"void",
"*",
"data",
",",
"unsigned",
"int",
"size",
")",
"{",
"lang_hooks",
".",
"lto",
".",
"append_data",
"(",
"(",
"const",
"char",
"*",
")",
"data",
",",
"size",
",",
"NULL",
")",
";",
"}"
] | Write SIZE bytes starting at DATA to the assembler. | [
"Write",
"SIZE",
"bytes",
"starting",
"at",
"DATA",
"to",
"the",
"assembler",
"."
] | [] | [
{
"param": "data",
"type": "void"
},
{
"param": "size",
"type": "unsigned int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "size",
"type": "unsigned int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_write_stream | void | void
lto_write_stream (struct lto_output_stream *obs)
{
unsigned int block_size = 1024;
struct lto_char_ptr_base *block;
struct lto_char_ptr_base *next_block;
if (!obs->first_block)
return;
for (block = obs->first_block; block; block = next_block)
{
const char *base = ((char *)block) + sizeof (struct lto_char_ptr_base);
unsigned int num_chars = block_size - sizeof (struct lto_char_ptr_base);
/* If this is not the last block, it is full. If it is the last
block, left_in_block indicates how many chars are unoccupied in
this block; subtract from num_chars to obtain occupancy. */
next_block = (struct lto_char_ptr_base *) block->ptr;
if (!next_block)
num_chars -= obs->left_in_block;
if (compression_stream)
lto_compress_block (compression_stream, base, num_chars);
else
lang_hooks.lto.append_data (base, num_chars, block);
free (block);
block_size *= 2;
}
} | /* Write all of the chars in OBS to the assembler. Recycle the blocks
in obs as this is being done. */ | Write all of the chars in OBS to the assembler. Recycle the blocks
in obs as this is being done. | [
"Write",
"all",
"of",
"the",
"chars",
"in",
"OBS",
"to",
"the",
"assembler",
".",
"Recycle",
"the",
"blocks",
"in",
"obs",
"as",
"this",
"is",
"being",
"done",
"."
] | void
lto_write_stream (struct lto_output_stream *obs)
{
unsigned int block_size = 1024;
struct lto_char_ptr_base *block;
struct lto_char_ptr_base *next_block;
if (!obs->first_block)
return;
for (block = obs->first_block; block; block = next_block)
{
const char *base = ((char *)block) + sizeof (struct lto_char_ptr_base);
unsigned int num_chars = block_size - sizeof (struct lto_char_ptr_base);
next_block = (struct lto_char_ptr_base *) block->ptr;
if (!next_block)
num_chars -= obs->left_in_block;
if (compression_stream)
lto_compress_block (compression_stream, base, num_chars);
else
lang_hooks.lto.append_data (base, num_chars, block);
free (block);
block_size *= 2;
}
} | [
"void",
"lto_write_stream",
"(",
"struct",
"lto_output_stream",
"*",
"obs",
")",
"{",
"unsigned",
"int",
"block_size",
"=",
"1024",
";",
"struct",
"lto_char_ptr_base",
"*",
"block",
";",
"struct",
"lto_char_ptr_base",
"*",
"next_block",
";",
"if",
"(",
"!",
"obs",
"->",
"first_block",
")",
"return",
";",
"for",
"(",
"block",
"=",
"obs",
"->",
"first_block",
";",
"block",
";",
"block",
"=",
"next_block",
")",
"{",
"const",
"char",
"*",
"base",
"=",
"(",
"(",
"char",
"*",
")",
"block",
")",
"+",
"sizeof",
"(",
"struct",
"lto_char_ptr_base",
")",
";",
"unsigned",
"int",
"num_chars",
"=",
"block_size",
"-",
"sizeof",
"(",
"struct",
"lto_char_ptr_base",
")",
";",
"next_block",
"=",
"(",
"struct",
"lto_char_ptr_base",
"*",
")",
"block",
"->",
"ptr",
";",
"if",
"(",
"!",
"next_block",
")",
"num_chars",
"-=",
"obs",
"->",
"left_in_block",
";",
"if",
"(",
"compression_stream",
")",
"lto_compress_block",
"(",
"compression_stream",
",",
"base",
",",
"num_chars",
")",
";",
"else",
"lang_hooks",
".",
"lto",
".",
"append_data",
"(",
"base",
",",
"num_chars",
",",
"block",
")",
";",
"free",
"(",
"block",
")",
";",
"block_size",
"*=",
"2",
";",
"}",
"}"
] | Write all of the chars in OBS to the assembler. | [
"Write",
"all",
"of",
"the",
"chars",
"in",
"OBS",
"to",
"the",
"assembler",
"."
] | [
"/* If this is not the last block, it is full. If it is the last\n\t block, left_in_block indicates how many chars are unoccupied in\n\t this block; subtract from num_chars to obtain occupancy. */"
] | [
{
"param": "obs",
"type": "struct lto_output_stream"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_field_decl_index | void | void
lto_output_field_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FIELD_DECL],
decl, &index);
} | /* Output a field DECL to OBS. */ | Output a field DECL to OBS. | [
"Output",
"a",
"field",
"DECL",
"to",
"OBS",
"."
] | void
lto_output_field_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FIELD_DECL],
decl, &index);
} | [
"void",
"lto_output_field_decl_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"decl",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_FIELD_DECL",
"]",
",",
"decl",
",",
"&",
"index",
")",
";",
"}"
] | Output a field DECL to OBS. | [
"Output",
"a",
"field",
"DECL",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "decl",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "decl",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_fn_decl_index | void | void
lto_output_fn_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FN_DECL],
decl, &index);
} | /* Output a function DECL to OBS. */ | Output a function DECL to OBS. | [
"Output",
"a",
"function",
"DECL",
"to",
"OBS",
"."
] | void
lto_output_fn_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FN_DECL],
decl, &index);
} | [
"void",
"lto_output_fn_decl_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"decl",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_FN_DECL",
"]",
",",
"decl",
",",
"&",
"index",
")",
";",
"}"
] | Output a function DECL to OBS. | [
"Output",
"a",
"function",
"DECL",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "decl",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "decl",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_namespace_decl_index | void | void
lto_output_namespace_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs,
&decl_state->streams[LTO_DECL_STREAM_NAMESPACE_DECL],
decl, &index);
} | /* Output a namespace DECL to OBS. */ | Output a namespace DECL to OBS. | [
"Output",
"a",
"namespace",
"DECL",
"to",
"OBS",
"."
] | void
lto_output_namespace_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs,
&decl_state->streams[LTO_DECL_STREAM_NAMESPACE_DECL],
decl, &index);
} | [
"void",
"lto_output_namespace_decl_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"decl",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_NAMESPACE_DECL",
"]",
",",
"decl",
",",
"&",
"index",
")",
";",
"}"
] | Output a namespace DECL to OBS. | [
"Output",
"a",
"namespace",
"DECL",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "decl",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "decl",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_var_decl_index | void | void
lto_output_var_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_VAR_DECL],
decl, &index);
} | /* Output a static or extern var DECL to OBS. */ | Output a static or extern var DECL to OBS. | [
"Output",
"a",
"static",
"or",
"extern",
"var",
"DECL",
"to",
"OBS",
"."
] | void
lto_output_var_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_VAR_DECL],
decl, &index);
} | [
"void",
"lto_output_var_decl_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"decl",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_VAR_DECL",
"]",
",",
"decl",
",",
"&",
"index",
")",
";",
"}"
] | Output a static or extern var DECL to OBS. | [
"Output",
"a",
"static",
"or",
"extern",
"var",
"DECL",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "decl",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "decl",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_type_decl_index | void | void
lto_output_type_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE_DECL],
decl, &index);
} | /* Output a type DECL to OBS. */ | Output a type DECL to OBS. | [
"Output",
"a",
"type",
"DECL",
"to",
"OBS",
"."
] | void
lto_output_type_decl_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE_DECL],
decl, &index);
} | [
"void",
"lto_output_type_decl_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"decl",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_TYPE_DECL",
"]",
",",
"decl",
",",
"&",
"index",
")",
";",
"}"
] | Output a type DECL to OBS. | [
"Output",
"a",
"type",
"DECL",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "decl",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "decl",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_output_type_ref_index | void | void
lto_output_type_ref_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream *obs, tree ref)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE],
ref, &index);
} | /* Output a type REF to OBS. */ | Output a type REF to OBS. | [
"Output",
"a",
"type",
"REF",
"to",
"OBS",
"."
] | void
lto_output_type_ref_index (struct lto_out_decl_state *decl_state,
struct lto_output_stream *obs, tree ref)
{
unsigned int index;
lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE],
ref, &index);
} | [
"void",
"lto_output_type_ref_index",
"(",
"struct",
"lto_out_decl_state",
"*",
"decl_state",
",",
"struct",
"lto_output_stream",
"*",
"obs",
",",
"tree",
"ref",
")",
"{",
"unsigned",
"int",
"index",
";",
"lto_output_decl_index",
"(",
"obs",
",",
"&",
"decl_state",
"->",
"streams",
"[",
"LTO_DECL_STREAM_TYPE",
"]",
",",
"ref",
",",
"&",
"index",
")",
";",
"}"
] | Output a type REF to OBS. | [
"Output",
"a",
"type",
"REF",
"to",
"OBS",
"."
] | [] | [
{
"param": "decl_state",
"type": "struct lto_out_decl_state"
},
{
"param": "obs",
"type": "struct lto_output_stream"
},
{
"param": "ref",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "decl_state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "obs",
"type": "struct lto_output_stream",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_create_simple_output_block | null | struct lto_simple_output_block *
lto_create_simple_output_block (enum lto_section_type section_type)
{
struct lto_simple_output_block *ob
= ((struct lto_simple_output_block *)
xcalloc (1, sizeof (struct lto_simple_output_block)));
ob->section_type = section_type;
ob->decl_state = lto_get_out_decl_state ();
ob->main_stream = ((struct lto_output_stream *)
xcalloc (1, sizeof (struct lto_output_stream)));
return ob;
} | /* Create the output block and return it. */ | Create the output block and return it. | [
"Create",
"the",
"output",
"block",
"and",
"return",
"it",
"."
] | struct lto_simple_output_block *
lto_create_simple_output_block (enum lto_section_type section_type)
{
struct lto_simple_output_block *ob
= ((struct lto_simple_output_block *)
xcalloc (1, sizeof (struct lto_simple_output_block)));
ob->section_type = section_type;
ob->decl_state = lto_get_out_decl_state ();
ob->main_stream = ((struct lto_output_stream *)
xcalloc (1, sizeof (struct lto_output_stream)));
return ob;
} | [
"struct",
"lto_simple_output_block",
"*",
"lto_create_simple_output_block",
"(",
"enum",
"lto_section_type",
"section_type",
")",
"{",
"struct",
"lto_simple_output_block",
"*",
"ob",
"=",
"(",
"(",
"struct",
"lto_simple_output_block",
"*",
")",
"xcalloc",
"(",
"1",
",",
"sizeof",
"(",
"struct",
"lto_simple_output_block",
")",
")",
")",
";",
"ob",
"->",
"section_type",
"=",
"section_type",
";",
"ob",
"->",
"decl_state",
"=",
"lto_get_out_decl_state",
"(",
")",
";",
"ob",
"->",
"main_stream",
"=",
"(",
"(",
"struct",
"lto_output_stream",
"*",
")",
"xcalloc",
"(",
"1",
",",
"sizeof",
"(",
"struct",
"lto_output_stream",
")",
")",
")",
";",
"return",
"ob",
";",
"}"
] | Create the output block and return it. | [
"Create",
"the",
"output",
"block",
"and",
"return",
"it",
"."
] | [] | [
{
"param": "section_type",
"type": "enum lto_section_type"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "section_type",
"type": "enum lto_section_type",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_destroy_simple_output_block | void | void
lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
{
char *section_name;
struct lto_simple_header header;
section_name = lto_get_section_name (ob->section_type, NULL, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* Write the header which says how to decode the pieces of the
t. */
memset (&header, 0, sizeof (struct lto_simple_header));
header.major_version = LTO_major_version;
header.minor_version = LTO_minor_version;
header.main_size = ob->main_stream->total_size;
lto_write_data (&header, sizeof header);
lto_write_stream (ob->main_stream);
/* Put back the assembly section that was there before we started
writing lto info. */
lto_end_section ();
free (ob->main_stream);
free (ob);
} | /* Produce a simple section for one of the ipa passes. */ | Produce a simple section for one of the ipa passes. | [
"Produce",
"a",
"simple",
"section",
"for",
"one",
"of",
"the",
"ipa",
"passes",
"."
] | void
lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
{
char *section_name;
struct lto_simple_header header;
section_name = lto_get_section_name (ob->section_type, NULL, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
memset (&header, 0, sizeof (struct lto_simple_header));
header.major_version = LTO_major_version;
header.minor_version = LTO_minor_version;
header.main_size = ob->main_stream->total_size;
lto_write_data (&header, sizeof header);
lto_write_stream (ob->main_stream);
lto_end_section ();
free (ob->main_stream);
free (ob);
} | [
"void",
"lto_destroy_simple_output_block",
"(",
"struct",
"lto_simple_output_block",
"*",
"ob",
")",
"{",
"char",
"*",
"section_name",
";",
"struct",
"lto_simple_header",
"header",
";",
"section_name",
"=",
"lto_get_section_name",
"(",
"ob",
"->",
"section_type",
",",
"NULL",
",",
"NULL",
")",
";",
"lto_begin_section",
"(",
"section_name",
",",
"!",
"flag_wpa",
")",
";",
"free",
"(",
"section_name",
")",
";",
"memset",
"(",
"&",
"header",
",",
"0",
",",
"sizeof",
"(",
"struct",
"lto_simple_header",
")",
")",
";",
"header",
".",
"major_version",
"=",
"LTO_major_version",
";",
"header",
".",
"minor_version",
"=",
"LTO_minor_version",
";",
"header",
".",
"main_size",
"=",
"ob",
"->",
"main_stream",
"->",
"total_size",
";",
"lto_write_data",
"(",
"&",
"header",
",",
"sizeof",
"header",
")",
";",
"lto_write_stream",
"(",
"ob",
"->",
"main_stream",
")",
";",
"lto_end_section",
"(",
")",
";",
"free",
"(",
"ob",
"->",
"main_stream",
")",
";",
"free",
"(",
"ob",
")",
";",
"}"
] | Produce a simple section for one of the ipa passes. | [
"Produce",
"a",
"simple",
"section",
"for",
"one",
"of",
"the",
"ipa",
"passes",
"."
] | [
"/* Write the header which says how to decode the pieces of the\n t. */",
"/* Put back the assembly section that was there before we started\n writing lto info. */"
] | [
{
"param": "ob",
"type": "struct lto_simple_output_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ob",
"type": "struct lto_simple_output_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_get_out_decl_state | null | struct lto_out_decl_state *
lto_get_out_decl_state (void)
{
return decl_state_stack.last ();
} | /* Get the currently used lto_out_decl_state structure. */ | Get the currently used lto_out_decl_state structure. | [
"Get",
"the",
"currently",
"used",
"lto_out_decl_state",
"structure",
"."
] | struct lto_out_decl_state *
lto_get_out_decl_state (void)
{
return decl_state_stack.last ();
} | [
"struct",
"lto_out_decl_state",
"*",
"lto_get_out_decl_state",
"(",
"void",
")",
"{",
"return",
"decl_state_stack",
".",
"last",
"(",
")",
";",
"}"
] | Get the currently used lto_out_decl_state structure. | [
"Get",
"the",
"currently",
"used",
"lto_out_decl_state",
"structure",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_push_out_decl_state | void | void
lto_push_out_decl_state (struct lto_out_decl_state *state)
{
decl_state_stack.safe_push (state);
} | /* Push STATE to top of out decl stack. */ | Push STATE to top of out decl stack. | [
"Push",
"STATE",
"to",
"top",
"of",
"out",
"decl",
"stack",
"."
] | void
lto_push_out_decl_state (struct lto_out_decl_state *state)
{
decl_state_stack.safe_push (state);
} | [
"void",
"lto_push_out_decl_state",
"(",
"struct",
"lto_out_decl_state",
"*",
"state",
")",
"{",
"decl_state_stack",
".",
"safe_push",
"(",
"state",
")",
";",
"}"
] | Push STATE to top of out decl stack. | [
"Push",
"STATE",
"to",
"top",
"of",
"out",
"decl",
"stack",
"."
] | [] | [
{
"param": "state",
"type": "struct lto_out_decl_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct lto_out_decl_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af0cad3f906e9a61a3052e82a1c4608dd5c8e181 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/lto-section-out.c | [
"BSD-3-Clause"
] | C | lto_pop_out_decl_state | null | struct lto_out_decl_state *
lto_pop_out_decl_state (void)
{
return decl_state_stack.pop ();
} | /* Pop the currently used out-decl state from top of stack. */ | Pop the currently used out-decl state from top of stack. | [
"Pop",
"the",
"currently",
"used",
"out",
"-",
"decl",
"state",
"from",
"top",
"of",
"stack",
"."
] | struct lto_out_decl_state *
lto_pop_out_decl_state (void)
{
return decl_state_stack.pop ();
} | [
"struct",
"lto_out_decl_state",
"*",
"lto_pop_out_decl_state",
"(",
"void",
")",
"{",
"return",
"decl_state_stack",
".",
"pop",
"(",
")",
";",
"}"
] | Pop the currently used out-decl state from top of stack. | [
"Pop",
"the",
"currently",
"used",
"out",
"-",
"decl",
"state",
"from",
"top",
"of",
"stack",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | add_stmt_to_eh_lp | void | void
add_stmt_to_eh_lp (gimple *t, int num)
{
add_stmt_to_eh_lp_fn (cfun, t, num);
} | /* Add statement T in the current function (cfun) to EH landing pad NUM. */ | Add statement T in the current function (cfun) to EH landing pad NUM. | [
"Add",
"statement",
"T",
"in",
"the",
"current",
"function",
"(",
"cfun",
")",
"to",
"EH",
"landing",
"pad",
"NUM",
"."
] | void
add_stmt_to_eh_lp (gimple *t, int num)
{
add_stmt_to_eh_lp_fn (cfun, t, num);
} | [
"void",
"add_stmt_to_eh_lp",
"(",
"gimple",
"*",
"t",
",",
"int",
"num",
")",
"{",
"add_stmt_to_eh_lp_fn",
"(",
"cfun",
",",
"t",
",",
"num",
")",
";",
"}"
] | Add statement T in the current function (cfun) to EH landing pad NUM. | [
"Add",
"statement",
"T",
"in",
"the",
"current",
"function",
"(",
"cfun",
")",
"to",
"EH",
"landing",
"pad",
"NUM",
"."
] | [] | [
{
"param": "t",
"type": "gimple"
},
{
"param": "num",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "num",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | record_stmt_eh_region | void | static void
record_stmt_eh_region (eh_region region, gimple *t)
{
if (region == NULL)
return;
if (region->type == ERT_MUST_NOT_THROW)
add_stmt_to_eh_lp_fn (cfun, t, -region->index);
else
{
eh_landing_pad lp = region->landing_pads;
if (lp == NULL)
lp = gen_eh_landing_pad (region);
else
gcc_assert (lp->next_lp == NULL);
add_stmt_to_eh_lp_fn (cfun, t, lp->index);
}
} | /* Add statement T to the single EH landing pad in REGION. */ | Add statement T to the single EH landing pad in REGION. | [
"Add",
"statement",
"T",
"to",
"the",
"single",
"EH",
"landing",
"pad",
"in",
"REGION",
"."
] | static void
record_stmt_eh_region (eh_region region, gimple *t)
{
if (region == NULL)
return;
if (region->type == ERT_MUST_NOT_THROW)
add_stmt_to_eh_lp_fn (cfun, t, -region->index);
else
{
eh_landing_pad lp = region->landing_pads;
if (lp == NULL)
lp = gen_eh_landing_pad (region);
else
gcc_assert (lp->next_lp == NULL);
add_stmt_to_eh_lp_fn (cfun, t, lp->index);
}
} | [
"static",
"void",
"record_stmt_eh_region",
"(",
"eh_region",
"region",
",",
"gimple",
"*",
"t",
")",
"{",
"if",
"(",
"region",
"==",
"NULL",
")",
"return",
";",
"if",
"(",
"region",
"->",
"type",
"==",
"ERT_MUST_NOT_THROW",
")",
"add_stmt_to_eh_lp_fn",
"(",
"cfun",
",",
"t",
",",
"-",
"region",
"->",
"index",
")",
";",
"else",
"{",
"eh_landing_pad",
"lp",
"=",
"region",
"->",
"landing_pads",
";",
"if",
"(",
"lp",
"==",
"NULL",
")",
"lp",
"=",
"gen_eh_landing_pad",
"(",
"region",
")",
";",
"else",
"gcc_assert",
"(",
"lp",
"->",
"next_lp",
"==",
"NULL",
")",
";",
"add_stmt_to_eh_lp_fn",
"(",
"cfun",
",",
"t",
",",
"lp",
"->",
"index",
")",
";",
"}",
"}"
] | Add statement T to the single EH landing pad in REGION. | [
"Add",
"statement",
"T",
"to",
"the",
"single",
"EH",
"landing",
"pad",
"in",
"REGION",
"."
] | [] | [
{
"param": "region",
"type": "eh_region"
},
{
"param": "t",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "region",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | remove_stmt_from_eh_lp_fn | bool | bool
remove_stmt_from_eh_lp_fn (struct function *ifun, gimple *t)
{
if (!get_eh_throw_stmt_table (ifun))
return false;
if (!get_eh_throw_stmt_table (ifun)->get (t))
return false;
get_eh_throw_stmt_table (ifun)->remove (t);
return true;
} | /* Remove statement T in function IFUN from its EH landing pad. */ | Remove statement T in function IFUN from its EH landing pad. | [
"Remove",
"statement",
"T",
"in",
"function",
"IFUN",
"from",
"its",
"EH",
"landing",
"pad",
"."
] | bool
remove_stmt_from_eh_lp_fn (struct function *ifun, gimple *t)
{
if (!get_eh_throw_stmt_table (ifun))
return false;
if (!get_eh_throw_stmt_table (ifun)->get (t))
return false;
get_eh_throw_stmt_table (ifun)->remove (t);
return true;
} | [
"bool",
"remove_stmt_from_eh_lp_fn",
"(",
"struct",
"function",
"*",
"ifun",
",",
"gimple",
"*",
"t",
")",
"{",
"if",
"(",
"!",
"get_eh_throw_stmt_table",
"(",
"ifun",
")",
")",
"return",
"false",
";",
"if",
"(",
"!",
"get_eh_throw_stmt_table",
"(",
"ifun",
")",
"->",
"get",
"(",
"t",
")",
")",
"return",
"false",
";",
"get_eh_throw_stmt_table",
"(",
"ifun",
")",
"->",
"remove",
"(",
"t",
")",
";",
"return",
"true",
";",
"}"
] | Remove statement T in function IFUN from its EH landing pad. | [
"Remove",
"statement",
"T",
"in",
"function",
"IFUN",
"from",
"its",
"EH",
"landing",
"pad",
"."
] | [] | [
{
"param": "ifun",
"type": "struct function"
},
{
"param": "t",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ifun",
"type": "struct function",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | remove_stmt_from_eh_lp | bool | bool
remove_stmt_from_eh_lp (gimple *t)
{
return remove_stmt_from_eh_lp_fn (cfun, t);
} | /* Remove statement T in the current function (cfun) from its
EH landing pad. */ | Remove statement T in the current function (cfun) from its
EH landing pad. | [
"Remove",
"statement",
"T",
"in",
"the",
"current",
"function",
"(",
"cfun",
")",
"from",
"its",
"EH",
"landing",
"pad",
"."
] | bool
remove_stmt_from_eh_lp (gimple *t)
{
return remove_stmt_from_eh_lp_fn (cfun, t);
} | [
"bool",
"remove_stmt_from_eh_lp",
"(",
"gimple",
"*",
"t",
")",
"{",
"return",
"remove_stmt_from_eh_lp_fn",
"(",
"cfun",
",",
"t",
")",
";",
"}"
] | Remove statement T in the current function (cfun) from its
EH landing pad. | [
"Remove",
"statement",
"T",
"in",
"the",
"current",
"function",
"(",
"cfun",
")",
"from",
"its",
"EH",
"landing",
"pad",
"."
] | [] | [
{
"param": "t",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lookup_stmt_eh_lp_fn | int | int
lookup_stmt_eh_lp_fn (struct function *ifun, gimple *t)
{
if (ifun->eh->throw_stmt_table == NULL)
return 0;
int *lp_nr = ifun->eh->throw_stmt_table->get (t);
return lp_nr ? *lp_nr : 0;
} | /* Determine if statement T is inside an EH region in function IFUN.
Positive numbers indicate a landing pad index; negative numbers
indicate a MUST_NOT_THROW region index; zero indicates that the
statement is not recorded in the region table. */ | Determine if statement T is inside an EH region in function IFUN.
Positive numbers indicate a landing pad index; negative numbers
indicate a MUST_NOT_THROW region index; zero indicates that the
statement is not recorded in the region table. | [
"Determine",
"if",
"statement",
"T",
"is",
"inside",
"an",
"EH",
"region",
"in",
"function",
"IFUN",
".",
"Positive",
"numbers",
"indicate",
"a",
"landing",
"pad",
"index",
";",
"negative",
"numbers",
"indicate",
"a",
"MUST_NOT_THROW",
"region",
"index",
";",
"zero",
"indicates",
"that",
"the",
"statement",
"is",
"not",
"recorded",
"in",
"the",
"region",
"table",
"."
] | int
lookup_stmt_eh_lp_fn (struct function *ifun, gimple *t)
{
if (ifun->eh->throw_stmt_table == NULL)
return 0;
int *lp_nr = ifun->eh->throw_stmt_table->get (t);
return lp_nr ? *lp_nr : 0;
} | [
"int",
"lookup_stmt_eh_lp_fn",
"(",
"struct",
"function",
"*",
"ifun",
",",
"gimple",
"*",
"t",
")",
"{",
"if",
"(",
"ifun",
"->",
"eh",
"->",
"throw_stmt_table",
"==",
"NULL",
")",
"return",
"0",
";",
"int",
"*",
"lp_nr",
"=",
"ifun",
"->",
"eh",
"->",
"throw_stmt_table",
"->",
"get",
"(",
"t",
")",
";",
"return",
"lp_nr",
"?",
"*",
"lp_nr",
":",
"0",
";",
"}"
] | Determine if statement T is inside an EH region in function IFUN. | [
"Determine",
"if",
"statement",
"T",
"is",
"inside",
"an",
"EH",
"region",
"in",
"function",
"IFUN",
"."
] | [] | [
{
"param": "ifun",
"type": "struct function"
},
{
"param": "t",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ifun",
"type": "struct function",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lookup_stmt_eh_lp | int | int
lookup_stmt_eh_lp (gimple *t)
{
/* We can get called from initialized data when -fnon-call-exceptions
is on; prevent crash. */
if (!cfun)
return 0;
return lookup_stmt_eh_lp_fn (cfun, t);
} | /* Likewise, but always use the current function. */ | Likewise, but always use the current function. | [
"Likewise",
"but",
"always",
"use",
"the",
"current",
"function",
"."
] | int
lookup_stmt_eh_lp (gimple *t)
{
if (!cfun)
return 0;
return lookup_stmt_eh_lp_fn (cfun, t);
} | [
"int",
"lookup_stmt_eh_lp",
"(",
"gimple",
"*",
"t",
")",
"{",
"if",
"(",
"!",
"cfun",
")",
"return",
"0",
";",
"return",
"lookup_stmt_eh_lp_fn",
"(",
"cfun",
",",
"t",
")",
";",
"}"
] | Likewise, but always use the current function. | [
"Likewise",
"but",
"always",
"use",
"the",
"current",
"function",
"."
] | [
"/* We can get called from initialized data when -fnon-call-exceptions\n is on; prevent crash. */"
] | [
{
"param": "t",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "t",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | collect_finally_tree_1 | void | static void
collect_finally_tree_1 (gimple_seq seq, gtry *region)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
collect_finally_tree (gsi_stmt (gsi), region);
} | /* Go through the gimple sequence. Works with collect_finally_tree to
record all GIMPLE_LABEL and GIMPLE_TRY statements. */ | Go through the gimple sequence. Works with collect_finally_tree to
record all GIMPLE_LABEL and GIMPLE_TRY statements. | [
"Go",
"through",
"the",
"gimple",
"sequence",
".",
"Works",
"with",
"collect_finally_tree",
"to",
"record",
"all",
"GIMPLE_LABEL",
"and",
"GIMPLE_TRY",
"statements",
"."
] | static void
collect_finally_tree_1 (gimple_seq seq, gtry *region)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
collect_finally_tree (gsi_stmt (gsi), region);
} | [
"static",
"void",
"collect_finally_tree_1",
"(",
"gimple_seq",
"seq",
",",
"gtry",
"*",
"region",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"for",
"(",
"gsi",
"=",
"gsi_start",
"(",
"seq",
")",
";",
"!",
"gsi_end_p",
"(",
"gsi",
")",
";",
"gsi_next",
"(",
"&",
"gsi",
")",
")",
"collect_finally_tree",
"(",
"gsi_stmt",
"(",
"gsi",
")",
",",
"region",
")",
";",
"}"
] | Go through the gimple sequence. | [
"Go",
"through",
"the",
"gimple",
"sequence",
"."
] | [] | [
{
"param": "seq",
"type": "gimple_seq"
},
{
"param": "region",
"type": "gtry"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "seq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "region",
"type": "gtry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | outside_finally_tree | bool | static bool
outside_finally_tree (treemple start, gimple *target)
{
struct finally_tree_node n, *p;
do
{
n.child = start;
p = finally_tree->find (&n);
if (!p)
return true;
start.g = p->parent;
}
while (start.g != target);
return false;
} | /* Use the finally tree to determine if a jump from START to TARGET
would leave the try_finally node that START lives in. */ | Use the finally tree to determine if a jump from START to TARGET
would leave the try_finally node that START lives in. | [
"Use",
"the",
"finally",
"tree",
"to",
"determine",
"if",
"a",
"jump",
"from",
"START",
"to",
"TARGET",
"would",
"leave",
"the",
"try_finally",
"node",
"that",
"START",
"lives",
"in",
"."
] | static bool
outside_finally_tree (treemple start, gimple *target)
{
struct finally_tree_node n, *p;
do
{
n.child = start;
p = finally_tree->find (&n);
if (!p)
return true;
start.g = p->parent;
}
while (start.g != target);
return false;
} | [
"static",
"bool",
"outside_finally_tree",
"(",
"treemple",
"start",
",",
"gimple",
"*",
"target",
")",
"{",
"struct",
"finally_tree_node",
"n",
",",
"*",
"p",
";",
"do",
"{",
"n",
".",
"child",
"=",
"start",
";",
"p",
"=",
"finally_tree",
"->",
"find",
"(",
"&",
"n",
")",
";",
"if",
"(",
"!",
"p",
")",
"return",
"true",
";",
"start",
".",
"g",
"=",
"p",
"->",
"parent",
";",
"}",
"while",
"(",
"start",
".",
"g",
"!=",
"target",
")",
";",
"return",
"false",
";",
"}"
] | Use the finally tree to determine if a jump from START to TARGET
would leave the try_finally node that START lives in. | [
"Use",
"the",
"finally",
"tree",
"to",
"determine",
"if",
"a",
"jump",
"from",
"START",
"to",
"TARGET",
"would",
"leave",
"the",
"try_finally",
"node",
"that",
"START",
"lives",
"in",
"."
] | [] | [
{
"param": "start",
"type": "treemple"
},
{
"param": "target",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "start",
"type": "treemple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | replace_goto_queue_cond_clause | void | static void
replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
gimple_stmt_iterator *gsi)
{
tree label;
gimple_seq new_seq;
treemple temp;
location_t loc = gimple_location (gsi_stmt (*gsi));
temp.tp = tp;
new_seq = find_goto_replacement (tf, temp);
if (!new_seq)
return;
if (gimple_seq_singleton_p (new_seq)
&& gimple_code (gimple_seq_first_stmt (new_seq)) == GIMPLE_GOTO)
{
*tp = gimple_goto_dest (gimple_seq_first_stmt (new_seq));
return;
}
label = create_artificial_label (loc);
/* Set the new label for the GIMPLE_COND */
*tp = label;
gsi_insert_after (gsi, gimple_build_label (label), GSI_CONTINUE_LINKING);
gsi_insert_seq_after (gsi, gimple_seq_copy (new_seq), GSI_CONTINUE_LINKING);
} | /* A subroutine of replace_goto_queue_1. Handles the sub-clauses of a
lowered GIMPLE_COND. If, by chance, the replacement is a simple goto,
then we can just splat it in, otherwise we add the new stmts immediately
after the GIMPLE_COND and redirect. */ | A subroutine of replace_goto_queue_1. Handles the sub-clauses of a
lowered GIMPLE_COND. If, by chance, the replacement is a simple goto,
then we can just splat it in, otherwise we add the new stmts immediately
after the GIMPLE_COND and redirect. | [
"A",
"subroutine",
"of",
"replace_goto_queue_1",
".",
"Handles",
"the",
"sub",
"-",
"clauses",
"of",
"a",
"lowered",
"GIMPLE_COND",
".",
"If",
"by",
"chance",
"the",
"replacement",
"is",
"a",
"simple",
"goto",
"then",
"we",
"can",
"just",
"splat",
"it",
"in",
"otherwise",
"we",
"add",
"the",
"new",
"stmts",
"immediately",
"after",
"the",
"GIMPLE_COND",
"and",
"redirect",
"."
] | static void
replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
gimple_stmt_iterator *gsi)
{
tree label;
gimple_seq new_seq;
treemple temp;
location_t loc = gimple_location (gsi_stmt (*gsi));
temp.tp = tp;
new_seq = find_goto_replacement (tf, temp);
if (!new_seq)
return;
if (gimple_seq_singleton_p (new_seq)
&& gimple_code (gimple_seq_first_stmt (new_seq)) == GIMPLE_GOTO)
{
*tp = gimple_goto_dest (gimple_seq_first_stmt (new_seq));
return;
}
label = create_artificial_label (loc);
*tp = label;
gsi_insert_after (gsi, gimple_build_label (label), GSI_CONTINUE_LINKING);
gsi_insert_seq_after (gsi, gimple_seq_copy (new_seq), GSI_CONTINUE_LINKING);
} | [
"static",
"void",
"replace_goto_queue_cond_clause",
"(",
"tree",
"*",
"tp",
",",
"struct",
"leh_tf_state",
"*",
"tf",
",",
"gimple_stmt_iterator",
"*",
"gsi",
")",
"{",
"tree",
"label",
";",
"gimple_seq",
"new_seq",
";",
"treemple",
"temp",
";",
"location_t",
"loc",
"=",
"gimple_location",
"(",
"gsi_stmt",
"(",
"*",
"gsi",
")",
")",
";",
"temp",
".",
"tp",
"=",
"tp",
";",
"new_seq",
"=",
"find_goto_replacement",
"(",
"tf",
",",
"temp",
")",
";",
"if",
"(",
"!",
"new_seq",
")",
"return",
";",
"if",
"(",
"gimple_seq_singleton_p",
"(",
"new_seq",
")",
"&&",
"gimple_code",
"(",
"gimple_seq_first_stmt",
"(",
"new_seq",
")",
")",
"==",
"GIMPLE_GOTO",
")",
"{",
"*",
"tp",
"=",
"gimple_goto_dest",
"(",
"gimple_seq_first_stmt",
"(",
"new_seq",
")",
")",
";",
"return",
";",
"}",
"label",
"=",
"create_artificial_label",
"(",
"loc",
")",
";",
"*",
"tp",
"=",
"label",
";",
"gsi_insert_after",
"(",
"gsi",
",",
"gimple_build_label",
"(",
"label",
")",
",",
"GSI_CONTINUE_LINKING",
")",
";",
"gsi_insert_seq_after",
"(",
"gsi",
",",
"gimple_seq_copy",
"(",
"new_seq",
")",
",",
"GSI_CONTINUE_LINKING",
")",
";",
"}"
] | A subroutine of replace_goto_queue_1. | [
"A",
"subroutine",
"of",
"replace_goto_queue_1",
"."
] | [
"/* Set the new label for the GIMPLE_COND */"
] | [
{
"param": "tp",
"type": "tree"
},
{
"param": "tf",
"type": "struct leh_tf_state"
},
{
"param": "gsi",
"type": "gimple_stmt_iterator"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tp",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "gsi",
"type": "gimple_stmt_iterator",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | replace_goto_queue | void | static void
replace_goto_queue (struct leh_tf_state *tf)
{
if (tf->goto_queue_active == 0)
return;
replace_goto_queue_stmt_list (&tf->top_p_seq, tf);
replace_goto_queue_stmt_list (&eh_seq, tf);
} | /* Replace all goto queue members. */ | Replace all goto queue members. | [
"Replace",
"all",
"goto",
"queue",
"members",
"."
] | static void
replace_goto_queue (struct leh_tf_state *tf)
{
if (tf->goto_queue_active == 0)
return;
replace_goto_queue_stmt_list (&tf->top_p_seq, tf);
replace_goto_queue_stmt_list (&eh_seq, tf);
} | [
"static",
"void",
"replace_goto_queue",
"(",
"struct",
"leh_tf_state",
"*",
"tf",
")",
"{",
"if",
"(",
"tf",
"->",
"goto_queue_active",
"==",
"0",
")",
"return",
";",
"replace_goto_queue_stmt_list",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"tf",
")",
";",
"replace_goto_queue_stmt_list",
"(",
"&",
"eh_seq",
",",
"tf",
")",
";",
"}"
] | Replace all goto queue members. | [
"Replace",
"all",
"goto",
"queue",
"members",
"."
] | [] | [
{
"param": "tf",
"type": "struct leh_tf_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | record_in_goto_queue_label | void | static void
record_in_goto_queue_label (struct leh_tf_state *tf, treemple stmt, tree label,
location_t location)
{
int index;
treemple temp, new_stmt;
if (!label)
return;
/* Computed and non-local gotos do not get processed. Given
their nature we can neither tell whether we've escaped the
finally block nor redirect them if we knew. */
if (TREE_CODE (label) != LABEL_DECL)
return;
/* No need to record gotos that don't leave the try block. */
temp.t = label;
if (!outside_finally_tree (temp, tf->try_finally_expr))
return;
if (! tf->dest_array.exists ())
{
tf->dest_array.create (10);
tf->dest_array.quick_push (label);
index = 0;
}
else
{
int n = tf->dest_array.length ();
for (index = 0; index < n; ++index)
if (tf->dest_array[index] == label)
break;
if (index == n)
tf->dest_array.safe_push (label);
}
/* In the case of a GOTO we want to record the destination label,
since with a GIMPLE_COND we have an easy access to the then/else
labels. */
new_stmt = stmt;
record_in_goto_queue (tf, new_stmt, index, true, location);
} | /* Record the LABEL label in the goto queue contained in TF.
TF is not null. */ | Record the LABEL label in the goto queue contained in TF.
TF is not null. | [
"Record",
"the",
"LABEL",
"label",
"in",
"the",
"goto",
"queue",
"contained",
"in",
"TF",
".",
"TF",
"is",
"not",
"null",
"."
] | static void
record_in_goto_queue_label (struct leh_tf_state *tf, treemple stmt, tree label,
location_t location)
{
int index;
treemple temp, new_stmt;
if (!label)
return;
if (TREE_CODE (label) != LABEL_DECL)
return;
temp.t = label;
if (!outside_finally_tree (temp, tf->try_finally_expr))
return;
if (! tf->dest_array.exists ())
{
tf->dest_array.create (10);
tf->dest_array.quick_push (label);
index = 0;
}
else
{
int n = tf->dest_array.length ();
for (index = 0; index < n; ++index)
if (tf->dest_array[index] == label)
break;
if (index == n)
tf->dest_array.safe_push (label);
}
new_stmt = stmt;
record_in_goto_queue (tf, new_stmt, index, true, location);
} | [
"static",
"void",
"record_in_goto_queue_label",
"(",
"struct",
"leh_tf_state",
"*",
"tf",
",",
"treemple",
"stmt",
",",
"tree",
"label",
",",
"location_t",
"location",
")",
"{",
"int",
"index",
";",
"treemple",
"temp",
",",
"new_stmt",
";",
"if",
"(",
"!",
"label",
")",
"return",
";",
"if",
"(",
"TREE_CODE",
"(",
"label",
")",
"!=",
"LABEL_DECL",
")",
"return",
";",
"temp",
".",
"t",
"=",
"label",
";",
"if",
"(",
"!",
"outside_finally_tree",
"(",
"temp",
",",
"tf",
"->",
"try_finally_expr",
")",
")",
"return",
";",
"if",
"(",
"!",
"tf",
"->",
"dest_array",
".",
"exists",
"(",
")",
")",
"{",
"tf",
"->",
"dest_array",
".",
"create",
"(",
"10",
")",
";",
"tf",
"->",
"dest_array",
".",
"quick_push",
"(",
"label",
")",
";",
"index",
"=",
"0",
";",
"}",
"else",
"{",
"int",
"n",
"=",
"tf",
"->",
"dest_array",
".",
"length",
"(",
")",
";",
"for",
"(",
"index",
"=",
"0",
";",
"index",
"<",
"n",
";",
"++",
"index",
")",
"if",
"(",
"tf",
"->",
"dest_array",
"[",
"index",
"]",
"==",
"label",
")",
"break",
";",
"if",
"(",
"index",
"==",
"n",
")",
"tf",
"->",
"dest_array",
".",
"safe_push",
"(",
"label",
")",
";",
"}",
"new_stmt",
"=",
"stmt",
";",
"record_in_goto_queue",
"(",
"tf",
",",
"new_stmt",
",",
"index",
",",
"true",
",",
"location",
")",
";",
"}"
] | Record the LABEL label in the goto queue contained in TF. | [
"Record",
"the",
"LABEL",
"label",
"in",
"the",
"goto",
"queue",
"contained",
"in",
"TF",
"."
] | [
"/* Computed and non-local gotos do not get processed. Given\n their nature we can neither tell whether we've escaped the\n finally block nor redirect them if we knew. */",
"/* No need to record gotos that don't leave the try block. */",
"/* In the case of a GOTO we want to record the destination label,\n since with a GIMPLE_COND we have an easy access to the then/else\n labels. */"
] | [
{
"param": "tf",
"type": "struct leh_tf_state"
},
{
"param": "stmt",
"type": "treemple"
},
{
"param": "label",
"type": "tree"
},
{
"param": "location",
"type": "location_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "stmt",
"type": "treemple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "label",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "location",
"type": "location_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | verify_norecord_switch_expr | void | static void
verify_norecord_switch_expr (struct leh_state *state,
gswitch *switch_expr)
{
struct leh_tf_state *tf = state->tf;
size_t i, n;
if (!tf)
return;
n = gimple_switch_num_labels (switch_expr);
for (i = 0; i < n; ++i)
{
treemple temp;
tree lab = CASE_LABEL (gimple_switch_label (switch_expr, i));
temp.t = lab;
gcc_assert (!outside_finally_tree (temp, tf->try_finally_expr));
}
} | /* We do not process GIMPLE_SWITCHes for now. As long as the original source
was in fact structured, and we've not yet done jump threading, then none
of the labels will leave outer GIMPLE_TRY_FINALLY nodes. Verify this. */ | We do not process GIMPLE_SWITCHes for now. As long as the original source
was in fact structured, and we've not yet done jump threading, then none
of the labels will leave outer GIMPLE_TRY_FINALLY nodes. Verify this. | [
"We",
"do",
"not",
"process",
"GIMPLE_SWITCHes",
"for",
"now",
".",
"As",
"long",
"as",
"the",
"original",
"source",
"was",
"in",
"fact",
"structured",
"and",
"we",
"'",
"ve",
"not",
"yet",
"done",
"jump",
"threading",
"then",
"none",
"of",
"the",
"labels",
"will",
"leave",
"outer",
"GIMPLE_TRY_FINALLY",
"nodes",
".",
"Verify",
"this",
"."
] | static void
verify_norecord_switch_expr (struct leh_state *state,
gswitch *switch_expr)
{
struct leh_tf_state *tf = state->tf;
size_t i, n;
if (!tf)
return;
n = gimple_switch_num_labels (switch_expr);
for (i = 0; i < n; ++i)
{
treemple temp;
tree lab = CASE_LABEL (gimple_switch_label (switch_expr, i));
temp.t = lab;
gcc_assert (!outside_finally_tree (temp, tf->try_finally_expr));
}
} | [
"static",
"void",
"verify_norecord_switch_expr",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"gswitch",
"*",
"switch_expr",
")",
"{",
"struct",
"leh_tf_state",
"*",
"tf",
"=",
"state",
"->",
"tf",
";",
"size_t",
"i",
",",
"n",
";",
"if",
"(",
"!",
"tf",
")",
"return",
";",
"n",
"=",
"gimple_switch_num_labels",
"(",
"switch_expr",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"++",
"i",
")",
"{",
"treemple",
"temp",
";",
"tree",
"lab",
"=",
"CASE_LABEL",
"(",
"gimple_switch_label",
"(",
"switch_expr",
",",
"i",
")",
")",
";",
"temp",
".",
"t",
"=",
"lab",
";",
"gcc_assert",
"(",
"!",
"outside_finally_tree",
"(",
"temp",
",",
"tf",
"->",
"try_finally_expr",
")",
")",
";",
"}",
"}"
] | We do not process GIMPLE_SWITCHes for now. | [
"We",
"do",
"not",
"process",
"GIMPLE_SWITCHes",
"for",
"now",
"."
] | [] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "switch_expr",
"type": "gswitch"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "switch_expr",
"type": "gswitch",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | do_return_redirection | void | static void
do_return_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod)
{
gimple *x;
/* In the case of a return, the queue node must be a gimple statement. */
gcc_assert (!q->is_label);
/* Note that the return value may have already been computed, e.g.,
int x;
int foo (void)
{
x = 0;
try {
return x;
} finally {
x++;
}
}
should return 0, not 1. We don't have to do anything to make
this happens because the return value has been placed in the
RESULT_DECL already. */
q->cont_stmt = q->stmt.g;
if (mod)
gimple_seq_add_seq (&q->repl_stmt, mod);
x = gimple_build_goto (finlab);
gimple_set_location (x, q->location);
gimple_seq_add_stmt (&q->repl_stmt, x);
} | /* Redirect a RETURN_EXPR pointed to by Q to FINLAB. If MOD is
non-null, insert it before the new branch. */ | Redirect a RETURN_EXPR pointed to by Q to FINLAB. If MOD is
non-null, insert it before the new branch. | [
"Redirect",
"a",
"RETURN_EXPR",
"pointed",
"to",
"by",
"Q",
"to",
"FINLAB",
".",
"If",
"MOD",
"is",
"non",
"-",
"null",
"insert",
"it",
"before",
"the",
"new",
"branch",
"."
] | static void
do_return_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod)
{
gimple *x;
gcc_assert (!q->is_label);
q->cont_stmt = q->stmt.g;
if (mod)
gimple_seq_add_seq (&q->repl_stmt, mod);
x = gimple_build_goto (finlab);
gimple_set_location (x, q->location);
gimple_seq_add_stmt (&q->repl_stmt, x);
} | [
"static",
"void",
"do_return_redirection",
"(",
"struct",
"goto_queue_node",
"*",
"q",
",",
"tree",
"finlab",
",",
"gimple_seq",
"mod",
")",
"{",
"gimple",
"*",
"x",
";",
"gcc_assert",
"(",
"!",
"q",
"->",
"is_label",
")",
";",
"q",
"->",
"cont_stmt",
"=",
"q",
"->",
"stmt",
".",
"g",
";",
"if",
"(",
"mod",
")",
"gimple_seq_add_seq",
"(",
"&",
"q",
"->",
"repl_stmt",
",",
"mod",
")",
";",
"x",
"=",
"gimple_build_goto",
"(",
"finlab",
")",
";",
"gimple_set_location",
"(",
"x",
",",
"q",
"->",
"location",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"q",
"->",
"repl_stmt",
",",
"x",
")",
";",
"}"
] | Redirect a RETURN_EXPR pointed to by Q to FINLAB. | [
"Redirect",
"a",
"RETURN_EXPR",
"pointed",
"to",
"by",
"Q",
"to",
"FINLAB",
"."
] | [
"/* In the case of a return, the queue node must be a gimple statement. */",
"/* Note that the return value may have already been computed, e.g.,\n\n\tint x;\n\tint foo (void)\n\t{\n\t x = 0;\n\t try {\n\t return x;\n\t } finally {\n\t x++;\n\t }\n\t}\n\n should return 0, not 1. We don't have to do anything to make\n this happens because the return value has been placed in the\n RESULT_DECL already. */"
] | [
{
"param": "q",
"type": "struct goto_queue_node"
},
{
"param": "finlab",
"type": "tree"
},
{
"param": "mod",
"type": "gimple_seq"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "q",
"type": "struct goto_queue_node",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "finlab",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "mod",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | emit_post_landing_pad | void | static void
emit_post_landing_pad (gimple_seq *seq, eh_region region)
{
eh_landing_pad lp = region->landing_pads;
glabel *x;
if (lp == NULL)
lp = gen_eh_landing_pad (region);
lp->post_landing_pad = create_artificial_label (UNKNOWN_LOCATION);
EH_LANDING_PAD_NR (lp->post_landing_pad) = lp->index;
x = gimple_build_label (lp->post_landing_pad);
gimple_seq_add_stmt (seq, x);
} | /* Emit a standard landing pad sequence into SEQ for REGION. */ | Emit a standard landing pad sequence into SEQ for REGION. | [
"Emit",
"a",
"standard",
"landing",
"pad",
"sequence",
"into",
"SEQ",
"for",
"REGION",
"."
] | static void
emit_post_landing_pad (gimple_seq *seq, eh_region region)
{
eh_landing_pad lp = region->landing_pads;
glabel *x;
if (lp == NULL)
lp = gen_eh_landing_pad (region);
lp->post_landing_pad = create_artificial_label (UNKNOWN_LOCATION);
EH_LANDING_PAD_NR (lp->post_landing_pad) = lp->index;
x = gimple_build_label (lp->post_landing_pad);
gimple_seq_add_stmt (seq, x);
} | [
"static",
"void",
"emit_post_landing_pad",
"(",
"gimple_seq",
"*",
"seq",
",",
"eh_region",
"region",
")",
"{",
"eh_landing_pad",
"lp",
"=",
"region",
"->",
"landing_pads",
";",
"glabel",
"*",
"x",
";",
"if",
"(",
"lp",
"==",
"NULL",
")",
"lp",
"=",
"gen_eh_landing_pad",
"(",
"region",
")",
";",
"lp",
"->",
"post_landing_pad",
"=",
"create_artificial_label",
"(",
"UNKNOWN_LOCATION",
")",
";",
"EH_LANDING_PAD_NR",
"(",
"lp",
"->",
"post_landing_pad",
")",
"=",
"lp",
"->",
"index",
";",
"x",
"=",
"gimple_build_label",
"(",
"lp",
"->",
"post_landing_pad",
")",
";",
"gimple_seq_add_stmt",
"(",
"seq",
",",
"x",
")",
";",
"}"
] | Emit a standard landing pad sequence into SEQ for REGION. | [
"Emit",
"a",
"standard",
"landing",
"pad",
"sequence",
"into",
"SEQ",
"for",
"REGION",
"."
] | [] | [
{
"param": "seq",
"type": "gimple_seq"
},
{
"param": "region",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "seq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "region",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | emit_resx | void | static void
emit_resx (gimple_seq *seq, eh_region region)
{
gresx *x = gimple_build_resx (region->index);
gimple_seq_add_stmt (seq, x);
if (region->outer)
record_stmt_eh_region (region->outer, x);
} | /* Emit a RESX statement into SEQ for REGION. */ | Emit a RESX statement into SEQ for REGION. | [
"Emit",
"a",
"RESX",
"statement",
"into",
"SEQ",
"for",
"REGION",
"."
] | static void
emit_resx (gimple_seq *seq, eh_region region)
{
gresx *x = gimple_build_resx (region->index);
gimple_seq_add_stmt (seq, x);
if (region->outer)
record_stmt_eh_region (region->outer, x);
} | [
"static",
"void",
"emit_resx",
"(",
"gimple_seq",
"*",
"seq",
",",
"eh_region",
"region",
")",
"{",
"gresx",
"*",
"x",
"=",
"gimple_build_resx",
"(",
"region",
"->",
"index",
")",
";",
"gimple_seq_add_stmt",
"(",
"seq",
",",
"x",
")",
";",
"if",
"(",
"region",
"->",
"outer",
")",
"record_stmt_eh_region",
"(",
"region",
"->",
"outer",
",",
"x",
")",
";",
"}"
] | Emit a RESX statement into SEQ for REGION. | [
"Emit",
"a",
"RESX",
"statement",
"into",
"SEQ",
"for",
"REGION",
"."
] | [] | [
{
"param": "seq",
"type": "gimple_seq"
},
{
"param": "region",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "seq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "region",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | emit_eh_dispatch | void | static void
emit_eh_dispatch (gimple_seq *seq, eh_region region)
{
geh_dispatch *x = gimple_build_eh_dispatch (region->index);
gimple_seq_add_stmt (seq, x);
} | /* Emit an EH_DISPATCH statement into SEQ for REGION. */ | Emit an EH_DISPATCH statement into SEQ for REGION. | [
"Emit",
"an",
"EH_DISPATCH",
"statement",
"into",
"SEQ",
"for",
"REGION",
"."
] | static void
emit_eh_dispatch (gimple_seq *seq, eh_region region)
{
geh_dispatch *x = gimple_build_eh_dispatch (region->index);
gimple_seq_add_stmt (seq, x);
} | [
"static",
"void",
"emit_eh_dispatch",
"(",
"gimple_seq",
"*",
"seq",
",",
"eh_region",
"region",
")",
"{",
"geh_dispatch",
"*",
"x",
"=",
"gimple_build_eh_dispatch",
"(",
"region",
"->",
"index",
")",
";",
"gimple_seq_add_stmt",
"(",
"seq",
",",
"x",
")",
";",
"}"
] | Emit an EH_DISPATCH statement into SEQ for REGION. | [
"Emit",
"an",
"EH_DISPATCH",
"statement",
"into",
"SEQ",
"for",
"REGION",
"."
] | [] | [
{
"param": "seq",
"type": "gimple_seq"
},
{
"param": "region",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "seq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "region",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | note_eh_region_may_contain_throw | void | static void
note_eh_region_may_contain_throw (eh_region region)
{
while (bitmap_set_bit (eh_region_may_contain_throw_map, region->index))
{
if (region->type == ERT_MUST_NOT_THROW)
break;
region = region->outer;
if (region == NULL)
break;
}
} | /* Note that the current EH region may contain a throw, or a
call to a function which itself may contain a throw. */ | Note that the current EH region may contain a throw, or a
call to a function which itself may contain a throw. | [
"Note",
"that",
"the",
"current",
"EH",
"region",
"may",
"contain",
"a",
"throw",
"or",
"a",
"call",
"to",
"a",
"function",
"which",
"itself",
"may",
"contain",
"a",
"throw",
"."
] | static void
note_eh_region_may_contain_throw (eh_region region)
{
while (bitmap_set_bit (eh_region_may_contain_throw_map, region->index))
{
if (region->type == ERT_MUST_NOT_THROW)
break;
region = region->outer;
if (region == NULL)
break;
}
} | [
"static",
"void",
"note_eh_region_may_contain_throw",
"(",
"eh_region",
"region",
")",
"{",
"while",
"(",
"bitmap_set_bit",
"(",
"eh_region_may_contain_throw_map",
",",
"region",
"->",
"index",
")",
")",
"{",
"if",
"(",
"region",
"->",
"type",
"==",
"ERT_MUST_NOT_THROW",
")",
"break",
";",
"region",
"=",
"region",
"->",
"outer",
";",
"if",
"(",
"region",
"==",
"NULL",
")",
"break",
";",
"}",
"}"
] | Note that the current EH region may contain a throw, or a
call to a function which itself may contain a throw. | [
"Note",
"that",
"the",
"current",
"EH",
"region",
"may",
"contain",
"a",
"throw",
"or",
"a",
"call",
"to",
"a",
"function",
"which",
"itself",
"may",
"contain",
"a",
"throw",
"."
] | [] | [
{
"param": "region",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "region",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | eh_region_may_contain_throw | bool | static inline bool
eh_region_may_contain_throw (eh_region r)
{
return r && bitmap_bit_p (eh_region_may_contain_throw_map, r->index);
} | /* Check if REGION has been marked as containing a throw. If REGION is
NULL, this predicate is false. */ | Check if REGION has been marked as containing a throw. If REGION is
NULL, this predicate is false. | [
"Check",
"if",
"REGION",
"has",
"been",
"marked",
"as",
"containing",
"a",
"throw",
".",
"If",
"REGION",
"is",
"NULL",
"this",
"predicate",
"is",
"false",
"."
] | static inline bool
eh_region_may_contain_throw (eh_region r)
{
return r && bitmap_bit_p (eh_region_may_contain_throw_map, r->index);
} | [
"static",
"inline",
"bool",
"eh_region_may_contain_throw",
"(",
"eh_region",
"r",
")",
"{",
"return",
"r",
"&&",
"bitmap_bit_p",
"(",
"eh_region_may_contain_throw_map",
",",
"r",
"->",
"index",
")",
";",
"}"
] | Check if REGION has been marked as containing a throw. | [
"Check",
"if",
"REGION",
"has",
"been",
"marked",
"as",
"containing",
"a",
"throw",
"."
] | [] | [
{
"param": "r",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "r",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_try_finally_dup_block | gimple_seq | static gimple_seq
lower_try_finally_dup_block (gimple_seq seq, struct leh_state *outer_state,
location_t loc)
{
gtry *region = NULL;
gimple_seq new_seq;
gimple_stmt_iterator gsi;
new_seq = copy_gimple_seq_and_replace_locals (seq);
for (gsi = gsi_start (new_seq); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
/* We duplicate __builtin_stack_restore at -O0 in the hope of eliminating
it on the EH paths. When it is not eliminated, make it transparent in
the debug info. */
if (gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE))
gimple_set_location (stmt, UNKNOWN_LOCATION);
else if (LOCATION_LOCUS (gimple_location (stmt)) == UNKNOWN_LOCATION)
{
tree block = gimple_block (stmt);
gimple_set_location (stmt, loc);
gimple_set_block (stmt, block);
}
}
if (outer_state->tf)
region = outer_state->tf->try_finally_expr;
collect_finally_tree_1 (new_seq, region);
return new_seq;
} | /* A subroutine of lower_try_finally. Duplicate the tree rooted at T.
Make sure to record all new labels found. */ | A subroutine of lower_try_finally. Duplicate the tree rooted at T.
Make sure to record all new labels found. | [
"A",
"subroutine",
"of",
"lower_try_finally",
".",
"Duplicate",
"the",
"tree",
"rooted",
"at",
"T",
".",
"Make",
"sure",
"to",
"record",
"all",
"new",
"labels",
"found",
"."
] | static gimple_seq
lower_try_finally_dup_block (gimple_seq seq, struct leh_state *outer_state,
location_t loc)
{
gtry *region = NULL;
gimple_seq new_seq;
gimple_stmt_iterator gsi;
new_seq = copy_gimple_seq_and_replace_locals (seq);
for (gsi = gsi_start (new_seq); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
if (gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE))
gimple_set_location (stmt, UNKNOWN_LOCATION);
else if (LOCATION_LOCUS (gimple_location (stmt)) == UNKNOWN_LOCATION)
{
tree block = gimple_block (stmt);
gimple_set_location (stmt, loc);
gimple_set_block (stmt, block);
}
}
if (outer_state->tf)
region = outer_state->tf->try_finally_expr;
collect_finally_tree_1 (new_seq, region);
return new_seq;
} | [
"static",
"gimple_seq",
"lower_try_finally_dup_block",
"(",
"gimple_seq",
"seq",
",",
"struct",
"leh_state",
"*",
"outer_state",
",",
"location_t",
"loc",
")",
"{",
"gtry",
"*",
"region",
"=",
"NULL",
";",
"gimple_seq",
"new_seq",
";",
"gimple_stmt_iterator",
"gsi",
";",
"new_seq",
"=",
"copy_gimple_seq_and_replace_locals",
"(",
"seq",
")",
";",
"for",
"(",
"gsi",
"=",
"gsi_start",
"(",
"new_seq",
")",
";",
"!",
"gsi_end_p",
"(",
"gsi",
")",
";",
"gsi_next",
"(",
"&",
"gsi",
")",
")",
"{",
"gimple",
"*",
"stmt",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"gimple_call_builtin_p",
"(",
"stmt",
",",
"BUILT_IN_STACK_RESTORE",
")",
")",
"gimple_set_location",
"(",
"stmt",
",",
"UNKNOWN_LOCATION",
")",
";",
"else",
"if",
"(",
"LOCATION_LOCUS",
"(",
"gimple_location",
"(",
"stmt",
")",
")",
"==",
"UNKNOWN_LOCATION",
")",
"{",
"tree",
"block",
"=",
"gimple_block",
"(",
"stmt",
")",
";",
"gimple_set_location",
"(",
"stmt",
",",
"loc",
")",
";",
"gimple_set_block",
"(",
"stmt",
",",
"block",
")",
";",
"}",
"}",
"if",
"(",
"outer_state",
"->",
"tf",
")",
"region",
"=",
"outer_state",
"->",
"tf",
"->",
"try_finally_expr",
";",
"collect_finally_tree_1",
"(",
"new_seq",
",",
"region",
")",
";",
"return",
"new_seq",
";",
"}"
] | A subroutine of lower_try_finally. | [
"A",
"subroutine",
"of",
"lower_try_finally",
"."
] | [
"/* We duplicate __builtin_stack_restore at -O0 in the hope of eliminating\n\t it on the EH paths. When it is not eliminated, make it transparent in\n\t the debug info. */"
] | [
{
"param": "seq",
"type": "gimple_seq"
},
{
"param": "outer_state",
"type": "struct leh_state"
},
{
"param": "loc",
"type": "location_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "seq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "outer_state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loc",
"type": "location_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_try_finally_fallthru_label | tree | static tree
lower_try_finally_fallthru_label (struct leh_tf_state *tf)
{
tree label = tf->fallthru_label;
treemple temp;
if (!label)
{
label = create_artificial_label (gimple_location (tf->try_finally_expr));
tf->fallthru_label = label;
if (tf->outer->tf)
{
temp.t = label;
record_in_finally_tree (temp, tf->outer->tf->try_finally_expr);
}
}
return label;
} | /* A subroutine of lower_try_finally. Create a fallthru label for
the given try_finally state. The only tricky bit here is that
we have to make sure to record the label in our outer context. */ | A subroutine of lower_try_finally. Create a fallthru label for
the given try_finally state. The only tricky bit here is that
we have to make sure to record the label in our outer context. | [
"A",
"subroutine",
"of",
"lower_try_finally",
".",
"Create",
"a",
"fallthru",
"label",
"for",
"the",
"given",
"try_finally",
"state",
".",
"The",
"only",
"tricky",
"bit",
"here",
"is",
"that",
"we",
"have",
"to",
"make",
"sure",
"to",
"record",
"the",
"label",
"in",
"our",
"outer",
"context",
"."
] | static tree
lower_try_finally_fallthru_label (struct leh_tf_state *tf)
{
tree label = tf->fallthru_label;
treemple temp;
if (!label)
{
label = create_artificial_label (gimple_location (tf->try_finally_expr));
tf->fallthru_label = label;
if (tf->outer->tf)
{
temp.t = label;
record_in_finally_tree (temp, tf->outer->tf->try_finally_expr);
}
}
return label;
} | [
"static",
"tree",
"lower_try_finally_fallthru_label",
"(",
"struct",
"leh_tf_state",
"*",
"tf",
")",
"{",
"tree",
"label",
"=",
"tf",
"->",
"fallthru_label",
";",
"treemple",
"temp",
";",
"if",
"(",
"!",
"label",
")",
"{",
"label",
"=",
"create_artificial_label",
"(",
"gimple_location",
"(",
"tf",
"->",
"try_finally_expr",
")",
")",
";",
"tf",
"->",
"fallthru_label",
"=",
"label",
";",
"if",
"(",
"tf",
"->",
"outer",
"->",
"tf",
")",
"{",
"temp",
".",
"t",
"=",
"label",
";",
"record_in_finally_tree",
"(",
"temp",
",",
"tf",
"->",
"outer",
"->",
"tf",
"->",
"try_finally_expr",
")",
";",
"}",
"}",
"return",
"label",
";",
"}"
] | A subroutine of lower_try_finally. | [
"A",
"subroutine",
"of",
"lower_try_finally",
"."
] | [] | [
{
"param": "tf",
"type": "struct leh_tf_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_try_finally_nofallthru | void | static void
lower_try_finally_nofallthru (struct leh_state *state,
struct leh_tf_state *tf)
{
tree lab;
gimple *x;
geh_else *eh_else;
gimple_seq finally;
struct goto_queue_node *q, *qe;
lab = create_artificial_label (gimple_location (tf->try_finally_expr));
/* We expect that tf->top_p is a GIMPLE_TRY. */
finally = gimple_try_cleanup (tf->top_p);
tf->top_p_seq = gimple_try_eval (tf->top_p);
x = gimple_build_label (lab);
gimple_seq_add_stmt (&tf->top_p_seq, x);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
for (; q < qe; ++q)
if (q->index < 0)
do_return_redirection (q, lab, NULL);
else
do_goto_redirection (q, lab, NULL, tf);
replace_goto_queue (tf);
/* Emit the finally block into the stream. Lower EH_ELSE at this time. */
eh_else = get_eh_else (finally);
if (eh_else)
{
finally = gimple_eh_else_n_body (eh_else);
lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
{
finally = gimple_eh_else_e_body (eh_else);
lower_eh_constructs_1 (state, &finally);
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
}
}
else
{
lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
{
emit_post_landing_pad (&eh_seq, tf->region);
x = gimple_build_goto (lab);
gimple_set_location (x, gimple_location (tf->try_finally_expr));
gimple_seq_add_stmt (&eh_seq, x);
}
}
} | /* A subroutine of lower_try_finally. We have determined that there is
no fallthru edge out of the finally block. This means that there is
no outgoing edge corresponding to any incoming edge. Restructure the
try_finally node for this special case. */ | A subroutine of lower_try_finally. We have determined that there is
no fallthru edge out of the finally block. This means that there is
no outgoing edge corresponding to any incoming edge. Restructure the
try_finally node for this special case. | [
"A",
"subroutine",
"of",
"lower_try_finally",
".",
"We",
"have",
"determined",
"that",
"there",
"is",
"no",
"fallthru",
"edge",
"out",
"of",
"the",
"finally",
"block",
".",
"This",
"means",
"that",
"there",
"is",
"no",
"outgoing",
"edge",
"corresponding",
"to",
"any",
"incoming",
"edge",
".",
"Restructure",
"the",
"try_finally",
"node",
"for",
"this",
"special",
"case",
"."
] | static void
lower_try_finally_nofallthru (struct leh_state *state,
struct leh_tf_state *tf)
{
tree lab;
gimple *x;
geh_else *eh_else;
gimple_seq finally;
struct goto_queue_node *q, *qe;
lab = create_artificial_label (gimple_location (tf->try_finally_expr));
finally = gimple_try_cleanup (tf->top_p);
tf->top_p_seq = gimple_try_eval (tf->top_p);
x = gimple_build_label (lab);
gimple_seq_add_stmt (&tf->top_p_seq, x);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
for (; q < qe; ++q)
if (q->index < 0)
do_return_redirection (q, lab, NULL);
else
do_goto_redirection (q, lab, NULL, tf);
replace_goto_queue (tf);
eh_else = get_eh_else (finally);
if (eh_else)
{
finally = gimple_eh_else_n_body (eh_else);
lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
{
finally = gimple_eh_else_e_body (eh_else);
lower_eh_constructs_1 (state, &finally);
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
}
}
else
{
lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
{
emit_post_landing_pad (&eh_seq, tf->region);
x = gimple_build_goto (lab);
gimple_set_location (x, gimple_location (tf->try_finally_expr));
gimple_seq_add_stmt (&eh_seq, x);
}
}
} | [
"static",
"void",
"lower_try_finally_nofallthru",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"struct",
"leh_tf_state",
"*",
"tf",
")",
"{",
"tree",
"lab",
";",
"gimple",
"*",
"x",
";",
"geh_else",
"*",
"eh_else",
";",
"gimple_seq",
"finally",
";",
"struct",
"goto_queue_node",
"*",
"q",
",",
"*",
"qe",
";",
"lab",
"=",
"create_artificial_label",
"(",
"gimple_location",
"(",
"tf",
"->",
"try_finally_expr",
")",
")",
";",
"finally",
"=",
"gimple_try_cleanup",
"(",
"tf",
"->",
"top_p",
")",
";",
"tf",
"->",
"top_p_seq",
"=",
"gimple_try_eval",
"(",
"tf",
"->",
"top_p",
")",
";",
"x",
"=",
"gimple_build_label",
"(",
"lab",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"x",
")",
";",
"q",
"=",
"tf",
"->",
"goto_queue",
";",
"qe",
"=",
"q",
"+",
"tf",
"->",
"goto_queue_active",
";",
"for",
"(",
";",
"q",
"<",
"qe",
";",
"++",
"q",
")",
"if",
"(",
"q",
"->",
"index",
"<",
"0",
")",
"do_return_redirection",
"(",
"q",
",",
"lab",
",",
"NULL",
")",
";",
"else",
"do_goto_redirection",
"(",
"q",
",",
"lab",
",",
"NULL",
",",
"tf",
")",
";",
"replace_goto_queue",
"(",
"tf",
")",
";",
"eh_else",
"=",
"get_eh_else",
"(",
"finally",
")",
";",
"if",
"(",
"eh_else",
")",
"{",
"finally",
"=",
"gimple_eh_else_n_body",
"(",
"eh_else",
")",
";",
"lower_eh_constructs_1",
"(",
"state",
",",
"&",
"finally",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"finally",
")",
";",
"if",
"(",
"tf",
"->",
"may_throw",
")",
"{",
"finally",
"=",
"gimple_eh_else_e_body",
"(",
"eh_else",
")",
";",
"lower_eh_constructs_1",
"(",
"state",
",",
"&",
"finally",
")",
";",
"emit_post_landing_pad",
"(",
"&",
"eh_seq",
",",
"tf",
"->",
"region",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"eh_seq",
",",
"finally",
")",
";",
"}",
"}",
"else",
"{",
"lower_eh_constructs_1",
"(",
"state",
",",
"&",
"finally",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"finally",
")",
";",
"if",
"(",
"tf",
"->",
"may_throw",
")",
"{",
"emit_post_landing_pad",
"(",
"&",
"eh_seq",
",",
"tf",
"->",
"region",
")",
";",
"x",
"=",
"gimple_build_goto",
"(",
"lab",
")",
";",
"gimple_set_location",
"(",
"x",
",",
"gimple_location",
"(",
"tf",
"->",
"try_finally_expr",
")",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"eh_seq",
",",
"x",
")",
";",
"}",
"}",
"}"
] | A subroutine of lower_try_finally. | [
"A",
"subroutine",
"of",
"lower_try_finally",
"."
] | [
"/* We expect that tf->top_p is a GIMPLE_TRY. */",
"/* Emit the finally block into the stream. Lower EH_ELSE at this time. */"
] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "tf",
"type": "struct leh_tf_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_try_finally_onedest | void | static void
lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
{
struct goto_queue_node *q, *qe;
geh_else *eh_else;
glabel *label_stmt;
gimple *x;
gimple_seq finally;
gimple_stmt_iterator gsi;
tree finally_label;
location_t loc = gimple_location (tf->try_finally_expr);
finally = gimple_try_cleanup (tf->top_p);
tf->top_p_seq = gimple_try_eval (tf->top_p);
/* Since there's only one destination, and the destination edge can only
either be EH or non-EH, that implies that all of our incoming edges
are of the same type. Therefore we can lower EH_ELSE immediately. */
eh_else = get_eh_else (finally);
if (eh_else)
{
if (tf->may_throw)
finally = gimple_eh_else_e_body (eh_else);
else
finally = gimple_eh_else_n_body (eh_else);
}
lower_eh_constructs_1 (state, &finally);
for (gsi = gsi_start (finally); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
if (LOCATION_LOCUS (gimple_location (stmt)) == UNKNOWN_LOCATION)
{
tree block = gimple_block (stmt);
gimple_set_location (stmt, gimple_location (tf->try_finally_expr));
gimple_set_block (stmt, block);
}
}
if (tf->may_throw)
{
/* Only reachable via the exception edge. Add the given label to
the head of the FINALLY block. Append a RESX at the end. */
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
emit_resx (&eh_seq, tf->region);
return;
}
if (tf->may_fallthru)
{
/* Only reachable via the fallthru edge. Do nothing but let
the two blocks run together; we'll fall out the bottom. */
gimple_seq_add_seq (&tf->top_p_seq, finally);
return;
}
finally_label = create_artificial_label (loc);
label_stmt = gimple_build_label (finally_label);
gimple_seq_add_stmt (&tf->top_p_seq, label_stmt);
gimple_seq_add_seq (&tf->top_p_seq, finally);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
if (tf->may_return)
{
/* Reachable by return expressions only. Redirect them. */
for (; q < qe; ++q)
do_return_redirection (q, finally_label, NULL);
replace_goto_queue (tf);
}
else
{
/* Reachable by goto expressions only. Redirect them. */
for (; q < qe; ++q)
do_goto_redirection (q, finally_label, NULL, tf);
replace_goto_queue (tf);
if (tf->dest_array[0] == tf->fallthru_label)
{
/* Reachable by goto to fallthru label only. Redirect it
to the new label (already created, sadly), and do not
emit the final branch out, or the fallthru label. */
tf->fallthru_label = NULL;
return;
}
}
/* Place the original return/goto to the original destination
immediately after the finally block. */
x = tf->goto_queue[0].cont_stmt;
gimple_seq_add_stmt (&tf->top_p_seq, x);
maybe_record_in_goto_queue (state, x);
} | /* A subroutine of lower_try_finally. We have determined that there is
exactly one destination of the finally block. Restructure the
try_finally node for this special case. */ | A subroutine of lower_try_finally. We have determined that there is
exactly one destination of the finally block. Restructure the
try_finally node for this special case. | [
"A",
"subroutine",
"of",
"lower_try_finally",
".",
"We",
"have",
"determined",
"that",
"there",
"is",
"exactly",
"one",
"destination",
"of",
"the",
"finally",
"block",
".",
"Restructure",
"the",
"try_finally",
"node",
"for",
"this",
"special",
"case",
"."
] | static void
lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
{
struct goto_queue_node *q, *qe;
geh_else *eh_else;
glabel *label_stmt;
gimple *x;
gimple_seq finally;
gimple_stmt_iterator gsi;
tree finally_label;
location_t loc = gimple_location (tf->try_finally_expr);
finally = gimple_try_cleanup (tf->top_p);
tf->top_p_seq = gimple_try_eval (tf->top_p);
eh_else = get_eh_else (finally);
if (eh_else)
{
if (tf->may_throw)
finally = gimple_eh_else_e_body (eh_else);
else
finally = gimple_eh_else_n_body (eh_else);
}
lower_eh_constructs_1 (state, &finally);
for (gsi = gsi_start (finally); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
if (LOCATION_LOCUS (gimple_location (stmt)) == UNKNOWN_LOCATION)
{
tree block = gimple_block (stmt);
gimple_set_location (stmt, gimple_location (tf->try_finally_expr));
gimple_set_block (stmt, block);
}
}
if (tf->may_throw)
{
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
emit_resx (&eh_seq, tf->region);
return;
}
if (tf->may_fallthru)
{
gimple_seq_add_seq (&tf->top_p_seq, finally);
return;
}
finally_label = create_artificial_label (loc);
label_stmt = gimple_build_label (finally_label);
gimple_seq_add_stmt (&tf->top_p_seq, label_stmt);
gimple_seq_add_seq (&tf->top_p_seq, finally);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
if (tf->may_return)
{
for (; q < qe; ++q)
do_return_redirection (q, finally_label, NULL);
replace_goto_queue (tf);
}
else
{
for (; q < qe; ++q)
do_goto_redirection (q, finally_label, NULL, tf);
replace_goto_queue (tf);
if (tf->dest_array[0] == tf->fallthru_label)
{
tf->fallthru_label = NULL;
return;
}
}
x = tf->goto_queue[0].cont_stmt;
gimple_seq_add_stmt (&tf->top_p_seq, x);
maybe_record_in_goto_queue (state, x);
} | [
"static",
"void",
"lower_try_finally_onedest",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"struct",
"leh_tf_state",
"*",
"tf",
")",
"{",
"struct",
"goto_queue_node",
"*",
"q",
",",
"*",
"qe",
";",
"geh_else",
"*",
"eh_else",
";",
"glabel",
"*",
"label_stmt",
";",
"gimple",
"*",
"x",
";",
"gimple_seq",
"finally",
";",
"gimple_stmt_iterator",
"gsi",
";",
"tree",
"finally_label",
";",
"location_t",
"loc",
"=",
"gimple_location",
"(",
"tf",
"->",
"try_finally_expr",
")",
";",
"finally",
"=",
"gimple_try_cleanup",
"(",
"tf",
"->",
"top_p",
")",
";",
"tf",
"->",
"top_p_seq",
"=",
"gimple_try_eval",
"(",
"tf",
"->",
"top_p",
")",
";",
"eh_else",
"=",
"get_eh_else",
"(",
"finally",
")",
";",
"if",
"(",
"eh_else",
")",
"{",
"if",
"(",
"tf",
"->",
"may_throw",
")",
"finally",
"=",
"gimple_eh_else_e_body",
"(",
"eh_else",
")",
";",
"else",
"finally",
"=",
"gimple_eh_else_n_body",
"(",
"eh_else",
")",
";",
"}",
"lower_eh_constructs_1",
"(",
"state",
",",
"&",
"finally",
")",
";",
"for",
"(",
"gsi",
"=",
"gsi_start",
"(",
"finally",
")",
";",
"!",
"gsi_end_p",
"(",
"gsi",
")",
";",
"gsi_next",
"(",
"&",
"gsi",
")",
")",
"{",
"gimple",
"*",
"stmt",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"LOCATION_LOCUS",
"(",
"gimple_location",
"(",
"stmt",
")",
")",
"==",
"UNKNOWN_LOCATION",
")",
"{",
"tree",
"block",
"=",
"gimple_block",
"(",
"stmt",
")",
";",
"gimple_set_location",
"(",
"stmt",
",",
"gimple_location",
"(",
"tf",
"->",
"try_finally_expr",
")",
")",
";",
"gimple_set_block",
"(",
"stmt",
",",
"block",
")",
";",
"}",
"}",
"if",
"(",
"tf",
"->",
"may_throw",
")",
"{",
"emit_post_landing_pad",
"(",
"&",
"eh_seq",
",",
"tf",
"->",
"region",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"eh_seq",
",",
"finally",
")",
";",
"emit_resx",
"(",
"&",
"eh_seq",
",",
"tf",
"->",
"region",
")",
";",
"return",
";",
"}",
"if",
"(",
"tf",
"->",
"may_fallthru",
")",
"{",
"gimple_seq_add_seq",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"finally",
")",
";",
"return",
";",
"}",
"finally_label",
"=",
"create_artificial_label",
"(",
"loc",
")",
";",
"label_stmt",
"=",
"gimple_build_label",
"(",
"finally_label",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"label_stmt",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"finally",
")",
";",
"q",
"=",
"tf",
"->",
"goto_queue",
";",
"qe",
"=",
"q",
"+",
"tf",
"->",
"goto_queue_active",
";",
"if",
"(",
"tf",
"->",
"may_return",
")",
"{",
"for",
"(",
";",
"q",
"<",
"qe",
";",
"++",
"q",
")",
"do_return_redirection",
"(",
"q",
",",
"finally_label",
",",
"NULL",
")",
";",
"replace_goto_queue",
"(",
"tf",
")",
";",
"}",
"else",
"{",
"for",
"(",
";",
"q",
"<",
"qe",
";",
"++",
"q",
")",
"do_goto_redirection",
"(",
"q",
",",
"finally_label",
",",
"NULL",
",",
"tf",
")",
";",
"replace_goto_queue",
"(",
"tf",
")",
";",
"if",
"(",
"tf",
"->",
"dest_array",
"[",
"0",
"]",
"==",
"tf",
"->",
"fallthru_label",
")",
"{",
"tf",
"->",
"fallthru_label",
"=",
"NULL",
";",
"return",
";",
"}",
"}",
"x",
"=",
"tf",
"->",
"goto_queue",
"[",
"0",
"]",
".",
"cont_stmt",
";",
"gimple_seq_add_stmt",
"(",
"&",
"tf",
"->",
"top_p_seq",
",",
"x",
")",
";",
"maybe_record_in_goto_queue",
"(",
"state",
",",
"x",
")",
";",
"}"
] | A subroutine of lower_try_finally. | [
"A",
"subroutine",
"of",
"lower_try_finally",
"."
] | [
"/* Since there's only one destination, and the destination edge can only\n either be EH or non-EH, that implies that all of our incoming edges\n are of the same type. Therefore we can lower EH_ELSE immediately. */",
"/* Only reachable via the exception edge. Add the given label to\n the head of the FINALLY block. Append a RESX at the end. */",
"/* Only reachable via the fallthru edge. Do nothing but let\n\t the two blocks run together; we'll fall out the bottom. */",
"/* Reachable by return expressions only. Redirect them. */",
"/* Reachable by goto expressions only. Redirect them. */",
"/* Reachable by goto to fallthru label only. Redirect it\n\t to the new label (already created, sadly), and do not\n\t emit the final branch out, or the fallthru label. */",
"/* Place the original return/goto to the original destination\n immediately after the finally block. */"
] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "tf",
"type": "struct leh_tf_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tf",
"type": "struct leh_tf_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | decide_copy_try_finally | bool | static bool
decide_copy_try_finally (int ndests, bool may_throw, gimple_seq finally)
{
int f_estimate, sw_estimate;
geh_else *eh_else;
/* If there's an EH_ELSE involved, the exception path is separate
and really doesn't come into play for this computation. */
eh_else = get_eh_else (finally);
if (eh_else)
{
ndests -= may_throw;
finally = gimple_eh_else_n_body (eh_else);
}
if (!optimize)
{
gimple_stmt_iterator gsi;
if (ndests == 1)
return true;
for (gsi = gsi_start (finally); !gsi_end_p (gsi); gsi_next (&gsi))
{
/* Duplicate __builtin_stack_restore in the hope of eliminating it
on the EH paths and, consequently, useless cleanups. */
gimple *stmt = gsi_stmt (gsi);
if (!is_gimple_debug (stmt)
&& !gimple_clobber_p (stmt)
&& !gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE))
return false;
}
return true;
}
/* Finally estimate N times, plus N gotos. */
f_estimate = estimate_num_insns_seq (finally, &eni_size_weights);
f_estimate = (f_estimate + 1) * ndests;
/* Switch statement (cost 10), N variable assignments, N gotos. */
sw_estimate = 10 + 2 * ndests;
/* Optimize for size clearly wants our best guess. */
if (optimize_function_for_size_p (cfun))
return f_estimate < sw_estimate;
/* ??? These numbers are completely made up so far. */
if (optimize > 1)
return f_estimate < 100 || f_estimate < sw_estimate * 2;
else
return f_estimate < 40 || f_estimate * 2 < sw_estimate * 3;
} | /* Decide whether or not we are going to duplicate the finally block.
There are several considerations.
Second, we'd like to prevent egregious code growth. One way to
do this is to estimate the size of the finally block, multiply
that by the number of copies we'd need to make, and compare against
the estimate of the size of the switch machinery we'd have to add. */ | Decide whether or not we are going to duplicate the finally block.
There are several considerations.
Second, we'd like to prevent egregious code growth. One way to
do this is to estimate the size of the finally block, multiply
that by the number of copies we'd need to make, and compare against
the estimate of the size of the switch machinery we'd have to add. | [
"Decide",
"whether",
"or",
"not",
"we",
"are",
"going",
"to",
"duplicate",
"the",
"finally",
"block",
".",
"There",
"are",
"several",
"considerations",
".",
"Second",
"we",
"'",
"d",
"like",
"to",
"prevent",
"egregious",
"code",
"growth",
".",
"One",
"way",
"to",
"do",
"this",
"is",
"to",
"estimate",
"the",
"size",
"of",
"the",
"finally",
"block",
"multiply",
"that",
"by",
"the",
"number",
"of",
"copies",
"we",
"'",
"d",
"need",
"to",
"make",
"and",
"compare",
"against",
"the",
"estimate",
"of",
"the",
"size",
"of",
"the",
"switch",
"machinery",
"we",
"'",
"d",
"have",
"to",
"add",
"."
] | static bool
decide_copy_try_finally (int ndests, bool may_throw, gimple_seq finally)
{
int f_estimate, sw_estimate;
geh_else *eh_else;
eh_else = get_eh_else (finally);
if (eh_else)
{
ndests -= may_throw;
finally = gimple_eh_else_n_body (eh_else);
}
if (!optimize)
{
gimple_stmt_iterator gsi;
if (ndests == 1)
return true;
for (gsi = gsi_start (finally); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
if (!is_gimple_debug (stmt)
&& !gimple_clobber_p (stmt)
&& !gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE))
return false;
}
return true;
}
f_estimate = estimate_num_insns_seq (finally, &eni_size_weights);
f_estimate = (f_estimate + 1) * ndests;
sw_estimate = 10 + 2 * ndests;
if (optimize_function_for_size_p (cfun))
return f_estimate < sw_estimate;
if (optimize > 1)
return f_estimate < 100 || f_estimate < sw_estimate * 2;
else
return f_estimate < 40 || f_estimate * 2 < sw_estimate * 3;
} | [
"static",
"bool",
"decide_copy_try_finally",
"(",
"int",
"ndests",
",",
"bool",
"may_throw",
",",
"gimple_seq",
"finally",
")",
"{",
"int",
"f_estimate",
",",
"sw_estimate",
";",
"geh_else",
"*",
"eh_else",
";",
"eh_else",
"=",
"get_eh_else",
"(",
"finally",
")",
";",
"if",
"(",
"eh_else",
")",
"{",
"ndests",
"-=",
"may_throw",
";",
"finally",
"=",
"gimple_eh_else_n_body",
"(",
"eh_else",
")",
";",
"}",
"if",
"(",
"!",
"optimize",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"if",
"(",
"ndests",
"==",
"1",
")",
"return",
"true",
";",
"for",
"(",
"gsi",
"=",
"gsi_start",
"(",
"finally",
")",
";",
"!",
"gsi_end_p",
"(",
"gsi",
")",
";",
"gsi_next",
"(",
"&",
"gsi",
")",
")",
"{",
"gimple",
"*",
"stmt",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"!",
"is_gimple_debug",
"(",
"stmt",
")",
"&&",
"!",
"gimple_clobber_p",
"(",
"stmt",
")",
"&&",
"!",
"gimple_call_builtin_p",
"(",
"stmt",
",",
"BUILT_IN_STACK_RESTORE",
")",
")",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
"f_estimate",
"=",
"estimate_num_insns_seq",
"(",
"finally",
",",
"&",
"eni_size_weights",
")",
";",
"f_estimate",
"=",
"(",
"f_estimate",
"+",
"1",
")",
"*",
"ndests",
";",
"sw_estimate",
"=",
"10",
"+",
"2",
"*",
"ndests",
";",
"if",
"(",
"optimize_function_for_size_p",
"(",
"cfun",
")",
")",
"return",
"f_estimate",
"<",
"sw_estimate",
";",
"if",
"(",
"optimize",
">",
"1",
")",
"return",
"f_estimate",
"<",
"100",
"||",
"f_estimate",
"<",
"sw_estimate",
"*",
"2",
";",
"else",
"return",
"f_estimate",
"<",
"40",
"||",
"f_estimate",
"*",
"2",
"<",
"sw_estimate",
"*",
"3",
";",
"}"
] | Decide whether or not we are going to duplicate the finally block. | [
"Decide",
"whether",
"or",
"not",
"we",
"are",
"going",
"to",
"duplicate",
"the",
"finally",
"block",
"."
] | [
"/* If there's an EH_ELSE involved, the exception path is separate\n and really doesn't come into play for this computation. */",
"/* Duplicate __builtin_stack_restore in the hope of eliminating it\n\t on the EH paths and, consequently, useless cleanups. */",
"/* Finally estimate N times, plus N gotos. */",
"/* Switch statement (cost 10), N variable assignments, N gotos. */",
"/* Optimize for size clearly wants our best guess. */",
"/* ??? These numbers are completely made up so far. */"
] | [
{
"param": "ndests",
"type": "int"
},
{
"param": "may_throw",
"type": "bool"
},
{
"param": "finally",
"type": "gimple_seq"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ndests",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "may_throw",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "finally",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | cleanup_is_dead_in | bool | static bool
cleanup_is_dead_in (eh_region reg)
{
while (reg && reg->type == ERT_CLEANUP)
reg = reg->outer;
return (reg && reg->type == ERT_MUST_NOT_THROW);
} | /* REG is the enclosing region for a possible cleanup region, or the region
itself. Returns TRUE if such a region would be unreachable.
Cleanup regions within a must-not-throw region aren't actually reachable
even if there are throwing stmts within them, because the personality
routine will call terminate before unwinding. */ | REG is the enclosing region for a possible cleanup region, or the region
itself. Returns TRUE if such a region would be unreachable.
Cleanup regions within a must-not-throw region aren't actually reachable
even if there are throwing stmts within them, because the personality
routine will call terminate before unwinding. | [
"REG",
"is",
"the",
"enclosing",
"region",
"for",
"a",
"possible",
"cleanup",
"region",
"or",
"the",
"region",
"itself",
".",
"Returns",
"TRUE",
"if",
"such",
"a",
"region",
"would",
"be",
"unreachable",
".",
"Cleanup",
"regions",
"within",
"a",
"must",
"-",
"not",
"-",
"throw",
"region",
"aren",
"'",
"t",
"actually",
"reachable",
"even",
"if",
"there",
"are",
"throwing",
"stmts",
"within",
"them",
"because",
"the",
"personality",
"routine",
"will",
"call",
"terminate",
"before",
"unwinding",
"."
] | static bool
cleanup_is_dead_in (eh_region reg)
{
while (reg && reg->type == ERT_CLEANUP)
reg = reg->outer;
return (reg && reg->type == ERT_MUST_NOT_THROW);
} | [
"static",
"bool",
"cleanup_is_dead_in",
"(",
"eh_region",
"reg",
")",
"{",
"while",
"(",
"reg",
"&&",
"reg",
"->",
"type",
"==",
"ERT_CLEANUP",
")",
"reg",
"=",
"reg",
"->",
"outer",
";",
"return",
"(",
"reg",
"&&",
"reg",
"->",
"type",
"==",
"ERT_MUST_NOT_THROW",
")",
";",
"}"
] | REG is the enclosing region for a possible cleanup region, or the region
itself. | [
"REG",
"is",
"the",
"enclosing",
"region",
"for",
"a",
"possible",
"cleanup",
"region",
"or",
"the",
"region",
"itself",
"."
] | [] | [
{
"param": "reg",
"type": "eh_region"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "reg",
"type": "eh_region",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_eh_filter | gimple_seq | static gimple_seq
lower_eh_filter (struct leh_state *state, gtry *tp)
{
struct leh_state this_state = *state;
eh_region this_region = NULL;
gimple *inner, *x;
gimple_seq new_seq;
inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
if (flag_exceptions)
{
this_region = gen_eh_region_allowed (state->cur_region,
gimple_eh_filter_types (inner));
this_state.cur_region = this_region;
}
lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
new_seq = NULL;
this_state.cur_region = state->cur_region;
this_state.ehp_region = this_region;
emit_eh_dispatch (&new_seq, this_region);
emit_resx (&new_seq, this_region);
this_region->u.allowed.label = create_artificial_label (UNKNOWN_LOCATION);
x = gimple_build_label (this_region->u.allowed.label);
gimple_seq_add_stmt (&new_seq, x);
lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure_ptr (inner));
gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
gimple_try_set_cleanup (tp, new_seq);
return frob_into_branch_around (tp, this_region, NULL);
} | /* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY with a
GIMPLE_EH_FILTER to a sequence of labels and blocks, plus the exception
region trees that record all the magic. */ | A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY with a
GIMPLE_EH_FILTER to a sequence of labels and blocks, plus the exception
region trees that record all the magic. | [
"A",
"subroutine",
"of",
"lower_eh_constructs_1",
".",
"Lower",
"a",
"GIMPLE_TRY",
"with",
"a",
"GIMPLE_EH_FILTER",
"to",
"a",
"sequence",
"of",
"labels",
"and",
"blocks",
"plus",
"the",
"exception",
"region",
"trees",
"that",
"record",
"all",
"the",
"magic",
"."
] | static gimple_seq
lower_eh_filter (struct leh_state *state, gtry *tp)
{
struct leh_state this_state = *state;
eh_region this_region = NULL;
gimple *inner, *x;
gimple_seq new_seq;
inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
if (flag_exceptions)
{
this_region = gen_eh_region_allowed (state->cur_region,
gimple_eh_filter_types (inner));
this_state.cur_region = this_region;
}
lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
new_seq = NULL;
this_state.cur_region = state->cur_region;
this_state.ehp_region = this_region;
emit_eh_dispatch (&new_seq, this_region);
emit_resx (&new_seq, this_region);
this_region->u.allowed.label = create_artificial_label (UNKNOWN_LOCATION);
x = gimple_build_label (this_region->u.allowed.label);
gimple_seq_add_stmt (&new_seq, x);
lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure_ptr (inner));
gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
gimple_try_set_cleanup (tp, new_seq);
return frob_into_branch_around (tp, this_region, NULL);
} | [
"static",
"gimple_seq",
"lower_eh_filter",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"gtry",
"*",
"tp",
")",
"{",
"struct",
"leh_state",
"this_state",
"=",
"*",
"state",
";",
"eh_region",
"this_region",
"=",
"NULL",
";",
"gimple",
"*",
"inner",
",",
"*",
"x",
";",
"gimple_seq",
"new_seq",
";",
"inner",
"=",
"gimple_seq_first_stmt",
"(",
"gimple_try_cleanup",
"(",
"tp",
")",
")",
";",
"if",
"(",
"flag_exceptions",
")",
"{",
"this_region",
"=",
"gen_eh_region_allowed",
"(",
"state",
"->",
"cur_region",
",",
"gimple_eh_filter_types",
"(",
"inner",
")",
")",
";",
"this_state",
".",
"cur_region",
"=",
"this_region",
";",
"}",
"lower_eh_constructs_1",
"(",
"&",
"this_state",
",",
"gimple_try_eval_ptr",
"(",
"tp",
")",
")",
";",
"if",
"(",
"!",
"eh_region_may_contain_throw",
"(",
"this_region",
")",
")",
"return",
"gimple_try_eval",
"(",
"tp",
")",
";",
"new_seq",
"=",
"NULL",
";",
"this_state",
".",
"cur_region",
"=",
"state",
"->",
"cur_region",
";",
"this_state",
".",
"ehp_region",
"=",
"this_region",
";",
"emit_eh_dispatch",
"(",
"&",
"new_seq",
",",
"this_region",
")",
";",
"emit_resx",
"(",
"&",
"new_seq",
",",
"this_region",
")",
";",
"this_region",
"->",
"u",
".",
"allowed",
".",
"label",
"=",
"create_artificial_label",
"(",
"UNKNOWN_LOCATION",
")",
";",
"x",
"=",
"gimple_build_label",
"(",
"this_region",
"->",
"u",
".",
"allowed",
".",
"label",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"new_seq",
",",
"x",
")",
";",
"lower_eh_constructs_1",
"(",
"&",
"this_state",
",",
"gimple_eh_filter_failure_ptr",
"(",
"inner",
")",
")",
";",
"gimple_seq_add_seq",
"(",
"&",
"new_seq",
",",
"gimple_eh_filter_failure",
"(",
"inner",
")",
")",
";",
"gimple_try_set_cleanup",
"(",
"tp",
",",
"new_seq",
")",
";",
"return",
"frob_into_branch_around",
"(",
"tp",
",",
"this_region",
",",
"NULL",
")",
";",
"}"
] | A subroutine of lower_eh_constructs_1. | [
"A",
"subroutine",
"of",
"lower_eh_constructs_1",
"."
] | [] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "tp",
"type": "gtry"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tp",
"type": "gtry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_cleanup | gimple_seq | static gimple_seq
lower_cleanup (struct leh_state *state, gtry *tp)
{
struct leh_state this_state = *state;
eh_region this_region = NULL;
struct leh_tf_state fake_tf;
gimple_seq result;
bool cleanup_dead = cleanup_is_dead_in (state->cur_region);
if (flag_exceptions && !cleanup_dead)
{
this_region = gen_eh_region_cleanup (state->cur_region);
this_state.cur_region = this_region;
}
lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (cleanup_dead || !eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
/* Build enough of a try-finally state so that we can reuse
honor_protect_cleanup_actions. */
memset (&fake_tf, 0, sizeof (fake_tf));
fake_tf.top_p = fake_tf.try_finally_expr = tp;
fake_tf.outer = state;
fake_tf.region = this_region;
fake_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
fake_tf.may_throw = true;
honor_protect_cleanup_actions (state, NULL, &fake_tf);
if (fake_tf.may_throw)
{
/* In this case honor_protect_cleanup_actions had nothing to do,
and we should process this normally. */
lower_eh_constructs_1 (state, gimple_try_cleanup_ptr (tp));
result = frob_into_branch_around (tp, this_region,
fake_tf.fallthru_label);
}
else
{
/* In this case honor_protect_cleanup_actions did nearly all of
the work. All we have left is to append the fallthru_label. */
result = gimple_try_eval (tp);
if (fake_tf.fallthru_label)
{
gimple *x = gimple_build_label (fake_tf.fallthru_label);
gimple_seq_add_stmt (&result, x);
}
}
return result;
} | /* Implement a cleanup expression. This is similar to try-finally,
except that we only execute the cleanup block for exception edges. */ | Implement a cleanup expression. This is similar to try-finally,
except that we only execute the cleanup block for exception edges. | [
"Implement",
"a",
"cleanup",
"expression",
".",
"This",
"is",
"similar",
"to",
"try",
"-",
"finally",
"except",
"that",
"we",
"only",
"execute",
"the",
"cleanup",
"block",
"for",
"exception",
"edges",
"."
] | static gimple_seq
lower_cleanup (struct leh_state *state, gtry *tp)
{
struct leh_state this_state = *state;
eh_region this_region = NULL;
struct leh_tf_state fake_tf;
gimple_seq result;
bool cleanup_dead = cleanup_is_dead_in (state->cur_region);
if (flag_exceptions && !cleanup_dead)
{
this_region = gen_eh_region_cleanup (state->cur_region);
this_state.cur_region = this_region;
}
lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (cleanup_dead || !eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
memset (&fake_tf, 0, sizeof (fake_tf));
fake_tf.top_p = fake_tf.try_finally_expr = tp;
fake_tf.outer = state;
fake_tf.region = this_region;
fake_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
fake_tf.may_throw = true;
honor_protect_cleanup_actions (state, NULL, &fake_tf);
if (fake_tf.may_throw)
{
lower_eh_constructs_1 (state, gimple_try_cleanup_ptr (tp));
result = frob_into_branch_around (tp, this_region,
fake_tf.fallthru_label);
}
else
{
result = gimple_try_eval (tp);
if (fake_tf.fallthru_label)
{
gimple *x = gimple_build_label (fake_tf.fallthru_label);
gimple_seq_add_stmt (&result, x);
}
}
return result;
} | [
"static",
"gimple_seq",
"lower_cleanup",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"gtry",
"*",
"tp",
")",
"{",
"struct",
"leh_state",
"this_state",
"=",
"*",
"state",
";",
"eh_region",
"this_region",
"=",
"NULL",
";",
"struct",
"leh_tf_state",
"fake_tf",
";",
"gimple_seq",
"result",
";",
"bool",
"cleanup_dead",
"=",
"cleanup_is_dead_in",
"(",
"state",
"->",
"cur_region",
")",
";",
"if",
"(",
"flag_exceptions",
"&&",
"!",
"cleanup_dead",
")",
"{",
"this_region",
"=",
"gen_eh_region_cleanup",
"(",
"state",
"->",
"cur_region",
")",
";",
"this_state",
".",
"cur_region",
"=",
"this_region",
";",
"}",
"lower_eh_constructs_1",
"(",
"&",
"this_state",
",",
"gimple_try_eval_ptr",
"(",
"tp",
")",
")",
";",
"if",
"(",
"cleanup_dead",
"||",
"!",
"eh_region_may_contain_throw",
"(",
"this_region",
")",
")",
"return",
"gimple_try_eval",
"(",
"tp",
")",
";",
"memset",
"(",
"&",
"fake_tf",
",",
"0",
",",
"sizeof",
"(",
"fake_tf",
")",
")",
";",
"fake_tf",
".",
"top_p",
"=",
"fake_tf",
".",
"try_finally_expr",
"=",
"tp",
";",
"fake_tf",
".",
"outer",
"=",
"state",
";",
"fake_tf",
".",
"region",
"=",
"this_region",
";",
"fake_tf",
".",
"may_fallthru",
"=",
"gimple_seq_may_fallthru",
"(",
"gimple_try_eval",
"(",
"tp",
")",
")",
";",
"fake_tf",
".",
"may_throw",
"=",
"true",
";",
"honor_protect_cleanup_actions",
"(",
"state",
",",
"NULL",
",",
"&",
"fake_tf",
")",
";",
"if",
"(",
"fake_tf",
".",
"may_throw",
")",
"{",
"lower_eh_constructs_1",
"(",
"state",
",",
"gimple_try_cleanup_ptr",
"(",
"tp",
")",
")",
";",
"result",
"=",
"frob_into_branch_around",
"(",
"tp",
",",
"this_region",
",",
"fake_tf",
".",
"fallthru_label",
")",
";",
"}",
"else",
"{",
"result",
"=",
"gimple_try_eval",
"(",
"tp",
")",
";",
"if",
"(",
"fake_tf",
".",
"fallthru_label",
")",
"{",
"gimple",
"*",
"x",
"=",
"gimple_build_label",
"(",
"fake_tf",
".",
"fallthru_label",
")",
";",
"gimple_seq_add_stmt",
"(",
"&",
"result",
",",
"x",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Implement a cleanup expression. | [
"Implement",
"a",
"cleanup",
"expression",
"."
] | [
"/* Build enough of a try-finally state so that we can reuse\n honor_protect_cleanup_actions. */",
"/* In this case honor_protect_cleanup_actions had nothing to do,\n\t and we should process this normally. */",
"/* In this case honor_protect_cleanup_actions did nearly all of\n\t the work. All we have left is to append the fallthru_label. */"
] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "tp",
"type": "gtry"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tp",
"type": "gtry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_eh_constructs_1 | void | static void
lower_eh_constructs_1 (struct leh_state *state, gimple_seq *pseq)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start (*pseq); !gsi_end_p (gsi);)
lower_eh_constructs_2 (state, &gsi);
} | /* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */ | A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. | [
"A",
"helper",
"to",
"unwrap",
"a",
"gimple_seq",
"and",
"feed",
"stmts",
"to",
"lower_eh_constructs_2",
"."
] | static void
lower_eh_constructs_1 (struct leh_state *state, gimple_seq *pseq)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start (*pseq); !gsi_end_p (gsi);)
lower_eh_constructs_2 (state, &gsi);
} | [
"static",
"void",
"lower_eh_constructs_1",
"(",
"struct",
"leh_state",
"*",
"state",
",",
"gimple_seq",
"*",
"pseq",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"for",
"(",
"gsi",
"=",
"gsi_start",
"(",
"*",
"pseq",
")",
";",
"!",
"gsi_end_p",
"(",
"gsi",
")",
";",
")",
"lower_eh_constructs_2",
"(",
"state",
",",
"&",
"gsi",
")",
";",
"}"
] | A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. | [
"A",
"helper",
"to",
"unwrap",
"a",
"gimple_seq",
"and",
"feed",
"stmts",
"to",
"lower_eh_constructs_2",
"."
] | [] | [
{
"param": "state",
"type": "struct leh_state"
},
{
"param": "pseq",
"type": "gimple_seq"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "struct leh_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pseq",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | make_eh_dispatch_edges | bool | bool
make_eh_dispatch_edges (geh_dispatch *stmt)
{
eh_region r;
eh_catch c;
basic_block src, dst;
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
src = gimple_bb (stmt);
switch (r->type)
{
case ERT_TRY:
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
dst = label_to_block (c->label);
make_edge (src, dst, 0);
/* A catch-all handler doesn't have a fallthru. */
if (c->type_list == NULL)
return false;
}
break;
case ERT_ALLOWED_EXCEPTIONS:
dst = label_to_block (r->u.allowed.label);
make_edge (src, dst, 0);
break;
default:
gcc_unreachable ();
}
return true;
} | /* Create the multiple edges from an EH_DISPATCH statement to all of
the possible handlers for its EH region. Return true if there's
no fallthru edge; false if there is. */ | Create the multiple edges from an EH_DISPATCH statement to all of
the possible handlers for its EH region. Return true if there's
no fallthru edge; false if there is. | [
"Create",
"the",
"multiple",
"edges",
"from",
"an",
"EH_DISPATCH",
"statement",
"to",
"all",
"of",
"the",
"possible",
"handlers",
"for",
"its",
"EH",
"region",
".",
"Return",
"true",
"if",
"there",
"'",
"s",
"no",
"fallthru",
"edge",
";",
"false",
"if",
"there",
"is",
"."
] | bool
make_eh_dispatch_edges (geh_dispatch *stmt)
{
eh_region r;
eh_catch c;
basic_block src, dst;
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
src = gimple_bb (stmt);
switch (r->type)
{
case ERT_TRY:
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
dst = label_to_block (c->label);
make_edge (src, dst, 0);
if (c->type_list == NULL)
return false;
}
break;
case ERT_ALLOWED_EXCEPTIONS:
dst = label_to_block (r->u.allowed.label);
make_edge (src, dst, 0);
break;
default:
gcc_unreachable ();
}
return true;
} | [
"bool",
"make_eh_dispatch_edges",
"(",
"geh_dispatch",
"*",
"stmt",
")",
"{",
"eh_region",
"r",
";",
"eh_catch",
"c",
";",
"basic_block",
"src",
",",
"dst",
";",
"r",
"=",
"get_eh_region_from_number",
"(",
"gimple_eh_dispatch_region",
"(",
"stmt",
")",
")",
";",
"src",
"=",
"gimple_bb",
"(",
"stmt",
")",
";",
"switch",
"(",
"r",
"->",
"type",
")",
"{",
"case",
"ERT_TRY",
":",
"for",
"(",
"c",
"=",
"r",
"->",
"u",
".",
"eh_try",
".",
"first_catch",
";",
"c",
";",
"c",
"=",
"c",
"->",
"next_catch",
")",
"{",
"dst",
"=",
"label_to_block",
"(",
"c",
"->",
"label",
")",
";",
"make_edge",
"(",
"src",
",",
"dst",
",",
"0",
")",
";",
"if",
"(",
"c",
"->",
"type_list",
"==",
"NULL",
")",
"return",
"false",
";",
"}",
"break",
";",
"case",
"ERT_ALLOWED_EXCEPTIONS",
":",
"dst",
"=",
"label_to_block",
"(",
"r",
"->",
"u",
".",
"allowed",
".",
"label",
")",
";",
"make_edge",
"(",
"src",
",",
"dst",
",",
"0",
")",
";",
"break",
";",
"default",
":",
"gcc_unreachable",
"(",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Create the multiple edges from an EH_DISPATCH statement to all of
the possible handlers for its EH region. | [
"Create",
"the",
"multiple",
"edges",
"from",
"an",
"EH_DISPATCH",
"statement",
"to",
"all",
"of",
"the",
"possible",
"handlers",
"for",
"its",
"EH",
"region",
"."
] | [
"/* A catch-all handler doesn't have a fallthru. */"
] | [
{
"param": "stmt",
"type": "geh_dispatch"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "geh_dispatch",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | make_eh_edges | void | void
make_eh_edges (gimple *stmt)
{
basic_block src, dst;
eh_landing_pad lp;
int lp_nr;
lp_nr = lookup_stmt_eh_lp (stmt);
if (lp_nr <= 0)
return;
lp = get_eh_landing_pad_from_number (lp_nr);
gcc_assert (lp != NULL);
src = gimple_bb (stmt);
dst = label_to_block (lp->post_landing_pad);
make_edge (src, dst, EDGE_EH);
} | /* Create the single EH edge from STMT to its nearest landing pad,
if there is such a landing pad within the current function. */ | Create the single EH edge from STMT to its nearest landing pad,
if there is such a landing pad within the current function. | [
"Create",
"the",
"single",
"EH",
"edge",
"from",
"STMT",
"to",
"its",
"nearest",
"landing",
"pad",
"if",
"there",
"is",
"such",
"a",
"landing",
"pad",
"within",
"the",
"current",
"function",
"."
] | void
make_eh_edges (gimple *stmt)
{
basic_block src, dst;
eh_landing_pad lp;
int lp_nr;
lp_nr = lookup_stmt_eh_lp (stmt);
if (lp_nr <= 0)
return;
lp = get_eh_landing_pad_from_number (lp_nr);
gcc_assert (lp != NULL);
src = gimple_bb (stmt);
dst = label_to_block (lp->post_landing_pad);
make_edge (src, dst, EDGE_EH);
} | [
"void",
"make_eh_edges",
"(",
"gimple",
"*",
"stmt",
")",
"{",
"basic_block",
"src",
",",
"dst",
";",
"eh_landing_pad",
"lp",
";",
"int",
"lp_nr",
";",
"lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"stmt",
")",
";",
"if",
"(",
"lp_nr",
"<=",
"0",
")",
"return",
";",
"lp",
"=",
"get_eh_landing_pad_from_number",
"(",
"lp_nr",
")",
";",
"gcc_assert",
"(",
"lp",
"!=",
"NULL",
")",
";",
"src",
"=",
"gimple_bb",
"(",
"stmt",
")",
";",
"dst",
"=",
"label_to_block",
"(",
"lp",
"->",
"post_landing_pad",
")",
";",
"make_edge",
"(",
"src",
",",
"dst",
",",
"EDGE_EH",
")",
";",
"}"
] | Create the single EH edge from STMT to its nearest landing pad,
if there is such a landing pad within the current function. | [
"Create",
"the",
"single",
"EH",
"edge",
"from",
"STMT",
"to",
"its",
"nearest",
"landing",
"pad",
"if",
"there",
"is",
"such",
"a",
"landing",
"pad",
"within",
"the",
"current",
"function",
"."
] | [] | [
{
"param": "stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | redirect_eh_edge_1 | void | static void
redirect_eh_edge_1 (edge edge_in, basic_block new_bb, bool change_region)
{
eh_landing_pad old_lp, new_lp;
basic_block old_bb;
gimple *throw_stmt;
int old_lp_nr, new_lp_nr;
tree old_label, new_label;
edge_iterator ei;
edge e;
old_bb = edge_in->dest;
old_label = gimple_block_label (old_bb);
old_lp_nr = EH_LANDING_PAD_NR (old_label);
gcc_assert (old_lp_nr > 0);
old_lp = get_eh_landing_pad_from_number (old_lp_nr);
throw_stmt = last_stmt (edge_in->src);
gcc_assert (lookup_stmt_eh_lp (throw_stmt) == old_lp_nr);
new_label = gimple_block_label (new_bb);
/* Look for an existing region that might be using NEW_BB already. */
new_lp_nr = EH_LANDING_PAD_NR (new_label);
if (new_lp_nr)
{
new_lp = get_eh_landing_pad_from_number (new_lp_nr);
gcc_assert (new_lp);
/* Unless CHANGE_REGION is true, the new and old landing pad
had better be associated with the same EH region. */
gcc_assert (change_region || new_lp->region == old_lp->region);
}
else
{
new_lp = NULL;
gcc_assert (!change_region);
}
/* Notice when we redirect the last EH edge away from OLD_BB. */
FOR_EACH_EDGE (e, ei, old_bb->preds)
if (e != edge_in && (e->flags & EDGE_EH))
break;
if (new_lp)
{
/* NEW_LP already exists. If there are still edges into OLD_LP,
there's nothing to do with the EH tree. If there are no more
edges into OLD_LP, then we want to remove OLD_LP as it is unused.
If CHANGE_REGION is true, then our caller is expecting to remove
the landing pad. */
if (e == NULL && !change_region)
remove_eh_landing_pad (old_lp);
}
else
{
/* No correct landing pad exists. If there are no more edges
into OLD_LP, then we can simply re-use the existing landing pad.
Otherwise, we have to create a new landing pad. */
if (e == NULL)
{
EH_LANDING_PAD_NR (old_lp->post_landing_pad) = 0;
new_lp = old_lp;
}
else
new_lp = gen_eh_landing_pad (old_lp->region);
new_lp->post_landing_pad = new_label;
EH_LANDING_PAD_NR (new_label) = new_lp->index;
}
/* Maybe move the throwing statement to the new region. */
if (old_lp != new_lp)
{
remove_stmt_from_eh_lp (throw_stmt);
add_stmt_to_eh_lp (throw_stmt, new_lp->index);
}
} | /* Do the work in redirecting EDGE_IN to NEW_BB within the EH region tree;
do not actually perform the final edge redirection.
CHANGE_REGION is true when we're being called from cleanup_empty_eh and
we intend to change the destination EH region as well; this means
EH_LANDING_PAD_NR must already be set on the destination block label.
If false, we're being called from generic cfg manipulation code and we
should preserve our place within the region tree. */ | Do the work in redirecting EDGE_IN to NEW_BB within the EH region tree;
do not actually perform the final edge redirection.
CHANGE_REGION is true when we're being called from cleanup_empty_eh and
we intend to change the destination EH region as well; this means
EH_LANDING_PAD_NR must already be set on the destination block label.
If false, we're being called from generic cfg manipulation code and we
should preserve our place within the region tree. | [
"Do",
"the",
"work",
"in",
"redirecting",
"EDGE_IN",
"to",
"NEW_BB",
"within",
"the",
"EH",
"region",
"tree",
";",
"do",
"not",
"actually",
"perform",
"the",
"final",
"edge",
"redirection",
".",
"CHANGE_REGION",
"is",
"true",
"when",
"we",
"'",
"re",
"being",
"called",
"from",
"cleanup_empty_eh",
"and",
"we",
"intend",
"to",
"change",
"the",
"destination",
"EH",
"region",
"as",
"well",
";",
"this",
"means",
"EH_LANDING_PAD_NR",
"must",
"already",
"be",
"set",
"on",
"the",
"destination",
"block",
"label",
".",
"If",
"false",
"we",
"'",
"re",
"being",
"called",
"from",
"generic",
"cfg",
"manipulation",
"code",
"and",
"we",
"should",
"preserve",
"our",
"place",
"within",
"the",
"region",
"tree",
"."
] | static void
redirect_eh_edge_1 (edge edge_in, basic_block new_bb, bool change_region)
{
eh_landing_pad old_lp, new_lp;
basic_block old_bb;
gimple *throw_stmt;
int old_lp_nr, new_lp_nr;
tree old_label, new_label;
edge_iterator ei;
edge e;
old_bb = edge_in->dest;
old_label = gimple_block_label (old_bb);
old_lp_nr = EH_LANDING_PAD_NR (old_label);
gcc_assert (old_lp_nr > 0);
old_lp = get_eh_landing_pad_from_number (old_lp_nr);
throw_stmt = last_stmt (edge_in->src);
gcc_assert (lookup_stmt_eh_lp (throw_stmt) == old_lp_nr);
new_label = gimple_block_label (new_bb);
new_lp_nr = EH_LANDING_PAD_NR (new_label);
if (new_lp_nr)
{
new_lp = get_eh_landing_pad_from_number (new_lp_nr);
gcc_assert (new_lp);
gcc_assert (change_region || new_lp->region == old_lp->region);
}
else
{
new_lp = NULL;
gcc_assert (!change_region);
}
FOR_EACH_EDGE (e, ei, old_bb->preds)
if (e != edge_in && (e->flags & EDGE_EH))
break;
if (new_lp)
{
if (e == NULL && !change_region)
remove_eh_landing_pad (old_lp);
}
else
{
if (e == NULL)
{
EH_LANDING_PAD_NR (old_lp->post_landing_pad) = 0;
new_lp = old_lp;
}
else
new_lp = gen_eh_landing_pad (old_lp->region);
new_lp->post_landing_pad = new_label;
EH_LANDING_PAD_NR (new_label) = new_lp->index;
}
if (old_lp != new_lp)
{
remove_stmt_from_eh_lp (throw_stmt);
add_stmt_to_eh_lp (throw_stmt, new_lp->index);
}
} | [
"static",
"void",
"redirect_eh_edge_1",
"(",
"edge",
"edge_in",
",",
"basic_block",
"new_bb",
",",
"bool",
"change_region",
")",
"{",
"eh_landing_pad",
"old_lp",
",",
"new_lp",
";",
"basic_block",
"old_bb",
";",
"gimple",
"*",
"throw_stmt",
";",
"int",
"old_lp_nr",
",",
"new_lp_nr",
";",
"tree",
"old_label",
",",
"new_label",
";",
"edge_iterator",
"ei",
";",
"edge",
"e",
";",
"old_bb",
"=",
"edge_in",
"->",
"dest",
";",
"old_label",
"=",
"gimple_block_label",
"(",
"old_bb",
")",
";",
"old_lp_nr",
"=",
"EH_LANDING_PAD_NR",
"(",
"old_label",
")",
";",
"gcc_assert",
"(",
"old_lp_nr",
">",
"0",
")",
";",
"old_lp",
"=",
"get_eh_landing_pad_from_number",
"(",
"old_lp_nr",
")",
";",
"throw_stmt",
"=",
"last_stmt",
"(",
"edge_in",
"->",
"src",
")",
";",
"gcc_assert",
"(",
"lookup_stmt_eh_lp",
"(",
"throw_stmt",
")",
"==",
"old_lp_nr",
")",
";",
"new_label",
"=",
"gimple_block_label",
"(",
"new_bb",
")",
";",
"new_lp_nr",
"=",
"EH_LANDING_PAD_NR",
"(",
"new_label",
")",
";",
"if",
"(",
"new_lp_nr",
")",
"{",
"new_lp",
"=",
"get_eh_landing_pad_from_number",
"(",
"new_lp_nr",
")",
";",
"gcc_assert",
"(",
"new_lp",
")",
";",
"gcc_assert",
"(",
"change_region",
"||",
"new_lp",
"->",
"region",
"==",
"old_lp",
"->",
"region",
")",
";",
"}",
"else",
"{",
"new_lp",
"=",
"NULL",
";",
"gcc_assert",
"(",
"!",
"change_region",
")",
";",
"}",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"if",
"(",
"e",
"!=",
"edge_in",
"&&",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
")",
"break",
";",
"if",
"(",
"new_lp",
")",
"{",
"if",
"(",
"e",
"==",
"NULL",
"&&",
"!",
"change_region",
")",
"remove_eh_landing_pad",
"(",
"old_lp",
")",
";",
"}",
"else",
"{",
"if",
"(",
"e",
"==",
"NULL",
")",
"{",
"EH_LANDING_PAD_NR",
"(",
"old_lp",
"->",
"post_landing_pad",
")",
"=",
"0",
";",
"new_lp",
"=",
"old_lp",
";",
"}",
"else",
"new_lp",
"=",
"gen_eh_landing_pad",
"(",
"old_lp",
"->",
"region",
")",
";",
"new_lp",
"->",
"post_landing_pad",
"=",
"new_label",
";",
"EH_LANDING_PAD_NR",
"(",
"new_label",
")",
"=",
"new_lp",
"->",
"index",
";",
"}",
"if",
"(",
"old_lp",
"!=",
"new_lp",
")",
"{",
"remove_stmt_from_eh_lp",
"(",
"throw_stmt",
")",
";",
"add_stmt_to_eh_lp",
"(",
"throw_stmt",
",",
"new_lp",
"->",
"index",
")",
";",
"}",
"}"
] | Do the work in redirecting EDGE_IN to NEW_BB within the EH region tree;
do not actually perform the final edge redirection. | [
"Do",
"the",
"work",
"in",
"redirecting",
"EDGE_IN",
"to",
"NEW_BB",
"within",
"the",
"EH",
"region",
"tree",
";",
"do",
"not",
"actually",
"perform",
"the",
"final",
"edge",
"redirection",
"."
] | [
"/* Look for an existing region that might be using NEW_BB already. */",
"/* Unless CHANGE_REGION is true, the new and old landing pad\n\t had better be associated with the same EH region. */",
"/* Notice when we redirect the last EH edge away from OLD_BB. */",
"/* NEW_LP already exists. If there are still edges into OLD_LP,\n\t there's nothing to do with the EH tree. If there are no more\n\t edges into OLD_LP, then we want to remove OLD_LP as it is unused.\n\t If CHANGE_REGION is true, then our caller is expecting to remove\n\t the landing pad. */",
"/* No correct landing pad exists. If there are no more edges\n\t into OLD_LP, then we can simply re-use the existing landing pad.\n\t Otherwise, we have to create a new landing pad. */",
"/* Maybe move the throwing statement to the new region. */"
] | [
{
"param": "edge_in",
"type": "edge"
},
{
"param": "new_bb",
"type": "basic_block"
},
{
"param": "change_region",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "edge_in",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "new_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "change_region",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | redirect_eh_edge | edge | edge
redirect_eh_edge (edge edge_in, basic_block new_bb)
{
redirect_eh_edge_1 (edge_in, new_bb, false);
return ssa_redirect_edge (edge_in, new_bb);
} | /* Redirect EH edge E to NEW_BB. */ | Redirect EH edge E to NEW_BB. | [
"Redirect",
"EH",
"edge",
"E",
"to",
"NEW_BB",
"."
] | edge
redirect_eh_edge (edge edge_in, basic_block new_bb)
{
redirect_eh_edge_1 (edge_in, new_bb, false);
return ssa_redirect_edge (edge_in, new_bb);
} | [
"edge",
"redirect_eh_edge",
"(",
"edge",
"edge_in",
",",
"basic_block",
"new_bb",
")",
"{",
"redirect_eh_edge_1",
"(",
"edge_in",
",",
"new_bb",
",",
"false",
")",
";",
"return",
"ssa_redirect_edge",
"(",
"edge_in",
",",
"new_bb",
")",
";",
"}"
] | Redirect EH edge E to NEW_BB. | [
"Redirect",
"EH",
"edge",
"E",
"to",
"NEW_BB",
"."
] | [] | [
{
"param": "edge_in",
"type": "edge"
},
{
"param": "new_bb",
"type": "basic_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "edge_in",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "new_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | redirect_eh_dispatch_edge | void | void
redirect_eh_dispatch_edge (geh_dispatch *stmt, edge e, basic_block new_bb)
{
tree new_lab = gimple_block_label (new_bb);
bool any_changed = false;
basic_block old_bb;
eh_region r;
eh_catch c;
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
switch (r->type)
{
case ERT_TRY:
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
old_bb = label_to_block (c->label);
if (old_bb == e->dest)
{
c->label = new_lab;
any_changed = true;
}
}
break;
case ERT_ALLOWED_EXCEPTIONS:
old_bb = label_to_block (r->u.allowed.label);
gcc_assert (old_bb == e->dest);
r->u.allowed.label = new_lab;
any_changed = true;
break;
default:
gcc_unreachable ();
}
gcc_assert (any_changed);
} | /* This is a subroutine of gimple_redirect_edge_and_branch. Update the
labels for redirecting a non-fallthru EH_DISPATCH edge E to NEW_BB.
The actual edge update will happen in the caller. */ | This is a subroutine of gimple_redirect_edge_and_branch. Update the
labels for redirecting a non-fallthru EH_DISPATCH edge E to NEW_BB.
The actual edge update will happen in the caller. | [
"This",
"is",
"a",
"subroutine",
"of",
"gimple_redirect_edge_and_branch",
".",
"Update",
"the",
"labels",
"for",
"redirecting",
"a",
"non",
"-",
"fallthru",
"EH_DISPATCH",
"edge",
"E",
"to",
"NEW_BB",
".",
"The",
"actual",
"edge",
"update",
"will",
"happen",
"in",
"the",
"caller",
"."
] | void
redirect_eh_dispatch_edge (geh_dispatch *stmt, edge e, basic_block new_bb)
{
tree new_lab = gimple_block_label (new_bb);
bool any_changed = false;
basic_block old_bb;
eh_region r;
eh_catch c;
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
switch (r->type)
{
case ERT_TRY:
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
old_bb = label_to_block (c->label);
if (old_bb == e->dest)
{
c->label = new_lab;
any_changed = true;
}
}
break;
case ERT_ALLOWED_EXCEPTIONS:
old_bb = label_to_block (r->u.allowed.label);
gcc_assert (old_bb == e->dest);
r->u.allowed.label = new_lab;
any_changed = true;
break;
default:
gcc_unreachable ();
}
gcc_assert (any_changed);
} | [
"void",
"redirect_eh_dispatch_edge",
"(",
"geh_dispatch",
"*",
"stmt",
",",
"edge",
"e",
",",
"basic_block",
"new_bb",
")",
"{",
"tree",
"new_lab",
"=",
"gimple_block_label",
"(",
"new_bb",
")",
";",
"bool",
"any_changed",
"=",
"false",
";",
"basic_block",
"old_bb",
";",
"eh_region",
"r",
";",
"eh_catch",
"c",
";",
"r",
"=",
"get_eh_region_from_number",
"(",
"gimple_eh_dispatch_region",
"(",
"stmt",
")",
")",
";",
"switch",
"(",
"r",
"->",
"type",
")",
"{",
"case",
"ERT_TRY",
":",
"for",
"(",
"c",
"=",
"r",
"->",
"u",
".",
"eh_try",
".",
"first_catch",
";",
"c",
";",
"c",
"=",
"c",
"->",
"next_catch",
")",
"{",
"old_bb",
"=",
"label_to_block",
"(",
"c",
"->",
"label",
")",
";",
"if",
"(",
"old_bb",
"==",
"e",
"->",
"dest",
")",
"{",
"c",
"->",
"label",
"=",
"new_lab",
";",
"any_changed",
"=",
"true",
";",
"}",
"}",
"break",
";",
"case",
"ERT_ALLOWED_EXCEPTIONS",
":",
"old_bb",
"=",
"label_to_block",
"(",
"r",
"->",
"u",
".",
"allowed",
".",
"label",
")",
";",
"gcc_assert",
"(",
"old_bb",
"==",
"e",
"->",
"dest",
")",
";",
"r",
"->",
"u",
".",
"allowed",
".",
"label",
"=",
"new_lab",
";",
"any_changed",
"=",
"true",
";",
"break",
";",
"default",
":",
"gcc_unreachable",
"(",
")",
";",
"}",
"gcc_assert",
"(",
"any_changed",
")",
";",
"}"
] | This is a subroutine of gimple_redirect_edge_and_branch. | [
"This",
"is",
"a",
"subroutine",
"of",
"gimple_redirect_edge_and_branch",
"."
] | [] | [
{
"param": "stmt",
"type": "geh_dispatch"
},
{
"param": "e",
"type": "edge"
},
{
"param": "new_bb",
"type": "basic_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "geh_dispatch",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "e",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "new_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | operation_could_trap_p | bool | bool
operation_could_trap_p (enum tree_code op, bool fp_operation, bool honor_trapv,
tree divisor)
{
bool honor_nans = (fp_operation && flag_trapping_math
&& !flag_finite_math_only);
bool honor_snans = fp_operation && flag_signaling_nans != 0;
bool handled;
if (TREE_CODE_CLASS (op) != tcc_comparison
&& TREE_CODE_CLASS (op) != tcc_unary
&& TREE_CODE_CLASS (op) != tcc_binary
&& op != FMA_EXPR)
return false;
return operation_could_trap_helper_p (op, fp_operation, honor_trapv,
honor_nans, honor_snans, divisor,
&handled);
} | /* Return true if operation OP may trap. FP_OPERATION is true if OP is applied
on floating-point values. HONOR_TRAPV is true if OP is applied on integer
type operands that may trap. If OP is a division operator, DIVISOR contains
the value of the divisor. */ | Return true if operation OP may trap. FP_OPERATION is true if OP is applied
on floating-point values. HONOR_TRAPV is true if OP is applied on integer
type operands that may trap. If OP is a division operator, DIVISOR contains
the value of the divisor. | [
"Return",
"true",
"if",
"operation",
"OP",
"may",
"trap",
".",
"FP_OPERATION",
"is",
"true",
"if",
"OP",
"is",
"applied",
"on",
"floating",
"-",
"point",
"values",
".",
"HONOR_TRAPV",
"is",
"true",
"if",
"OP",
"is",
"applied",
"on",
"integer",
"type",
"operands",
"that",
"may",
"trap",
".",
"If",
"OP",
"is",
"a",
"division",
"operator",
"DIVISOR",
"contains",
"the",
"value",
"of",
"the",
"divisor",
"."
] | bool
operation_could_trap_p (enum tree_code op, bool fp_operation, bool honor_trapv,
tree divisor)
{
bool honor_nans = (fp_operation && flag_trapping_math
&& !flag_finite_math_only);
bool honor_snans = fp_operation && flag_signaling_nans != 0;
bool handled;
if (TREE_CODE_CLASS (op) != tcc_comparison
&& TREE_CODE_CLASS (op) != tcc_unary
&& TREE_CODE_CLASS (op) != tcc_binary
&& op != FMA_EXPR)
return false;
return operation_could_trap_helper_p (op, fp_operation, honor_trapv,
honor_nans, honor_snans, divisor,
&handled);
} | [
"bool",
"operation_could_trap_p",
"(",
"enum",
"tree_code",
"op",
",",
"bool",
"fp_operation",
",",
"bool",
"honor_trapv",
",",
"tree",
"divisor",
")",
"{",
"bool",
"honor_nans",
"=",
"(",
"fp_operation",
"&&",
"flag_trapping_math",
"&&",
"!",
"flag_finite_math_only",
")",
";",
"bool",
"honor_snans",
"=",
"fp_operation",
"&&",
"flag_signaling_nans",
"!=",
"0",
";",
"bool",
"handled",
";",
"if",
"(",
"TREE_CODE_CLASS",
"(",
"op",
")",
"!=",
"tcc_comparison",
"&&",
"TREE_CODE_CLASS",
"(",
"op",
")",
"!=",
"tcc_unary",
"&&",
"TREE_CODE_CLASS",
"(",
"op",
")",
"!=",
"tcc_binary",
"&&",
"op",
"!=",
"FMA_EXPR",
")",
"return",
"false",
";",
"return",
"operation_could_trap_helper_p",
"(",
"op",
",",
"fp_operation",
",",
"honor_trapv",
",",
"honor_nans",
",",
"honor_snans",
",",
"divisor",
",",
"&",
"handled",
")",
";",
"}"
] | Return true if operation OP may trap. | [
"Return",
"true",
"if",
"operation",
"OP",
"may",
"trap",
"."
] | [] | [
{
"param": "op",
"type": "enum tree_code"
},
{
"param": "fp_operation",
"type": "bool"
},
{
"param": "honor_trapv",
"type": "bool"
},
{
"param": "divisor",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "op",
"type": "enum tree_code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "fp_operation",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "honor_trapv",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "divisor",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | in_array_bounds_p | bool | static bool
in_array_bounds_p (tree ref)
{
tree idx = TREE_OPERAND (ref, 1);
tree min, max;
if (TREE_CODE (idx) != INTEGER_CST)
return false;
min = array_ref_low_bound (ref);
max = array_ref_up_bound (ref);
if (!min
|| !max
|| TREE_CODE (min) != INTEGER_CST
|| TREE_CODE (max) != INTEGER_CST)
return false;
if (tree_int_cst_lt (idx, min)
|| tree_int_cst_lt (max, idx))
return false;
return true;
} | /* Returns true if it is possible to prove that the index of
an array access REF (an ARRAY_REF expression) falls into the
array bounds. */ | Returns true if it is possible to prove that the index of
an array access REF (an ARRAY_REF expression) falls into the
array bounds. | [
"Returns",
"true",
"if",
"it",
"is",
"possible",
"to",
"prove",
"that",
"the",
"index",
"of",
"an",
"array",
"access",
"REF",
"(",
"an",
"ARRAY_REF",
"expression",
")",
"falls",
"into",
"the",
"array",
"bounds",
"."
] | static bool
in_array_bounds_p (tree ref)
{
tree idx = TREE_OPERAND (ref, 1);
tree min, max;
if (TREE_CODE (idx) != INTEGER_CST)
return false;
min = array_ref_low_bound (ref);
max = array_ref_up_bound (ref);
if (!min
|| !max
|| TREE_CODE (min) != INTEGER_CST
|| TREE_CODE (max) != INTEGER_CST)
return false;
if (tree_int_cst_lt (idx, min)
|| tree_int_cst_lt (max, idx))
return false;
return true;
} | [
"static",
"bool",
"in_array_bounds_p",
"(",
"tree",
"ref",
")",
"{",
"tree",
"idx",
"=",
"TREE_OPERAND",
"(",
"ref",
",",
"1",
")",
";",
"tree",
"min",
",",
"max",
";",
"if",
"(",
"TREE_CODE",
"(",
"idx",
")",
"!=",
"INTEGER_CST",
")",
"return",
"false",
";",
"min",
"=",
"array_ref_low_bound",
"(",
"ref",
")",
";",
"max",
"=",
"array_ref_up_bound",
"(",
"ref",
")",
";",
"if",
"(",
"!",
"min",
"||",
"!",
"max",
"||",
"TREE_CODE",
"(",
"min",
")",
"!=",
"INTEGER_CST",
"||",
"TREE_CODE",
"(",
"max",
")",
"!=",
"INTEGER_CST",
")",
"return",
"false",
";",
"if",
"(",
"tree_int_cst_lt",
"(",
"idx",
",",
"min",
")",
"||",
"tree_int_cst_lt",
"(",
"max",
",",
"idx",
")",
")",
"return",
"false",
";",
"return",
"true",
";",
"}"
] | Returns true if it is possible to prove that the index of
an array access REF (an ARRAY_REF expression) falls into the
array bounds. | [
"Returns",
"true",
"if",
"it",
"is",
"possible",
"to",
"prove",
"that",
"the",
"index",
"of",
"an",
"array",
"access",
"REF",
"(",
"an",
"ARRAY_REF",
"expression",
")",
"falls",
"into",
"the",
"array",
"bounds",
"."
] | [] | [
{
"param": "ref",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ref",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | range_in_array_bounds_p | bool | static bool
range_in_array_bounds_p (tree ref)
{
tree domain_type = TYPE_DOMAIN (TREE_TYPE (ref));
tree range_min, range_max, min, max;
range_min = TYPE_MIN_VALUE (domain_type);
range_max = TYPE_MAX_VALUE (domain_type);
if (!range_min
|| !range_max
|| TREE_CODE (range_min) != INTEGER_CST
|| TREE_CODE (range_max) != INTEGER_CST)
return false;
min = array_ref_low_bound (ref);
max = array_ref_up_bound (ref);
if (!min
|| !max
|| TREE_CODE (min) != INTEGER_CST
|| TREE_CODE (max) != INTEGER_CST)
return false;
if (tree_int_cst_lt (range_min, min)
|| tree_int_cst_lt (max, range_max))
return false;
return true;
} | /* Returns true if it is possible to prove that the range of
an array access REF (an ARRAY_RANGE_REF expression) falls
into the array bounds. */ | Returns true if it is possible to prove that the range of
an array access REF (an ARRAY_RANGE_REF expression) falls
into the array bounds. | [
"Returns",
"true",
"if",
"it",
"is",
"possible",
"to",
"prove",
"that",
"the",
"range",
"of",
"an",
"array",
"access",
"REF",
"(",
"an",
"ARRAY_RANGE_REF",
"expression",
")",
"falls",
"into",
"the",
"array",
"bounds",
"."
] | static bool
range_in_array_bounds_p (tree ref)
{
tree domain_type = TYPE_DOMAIN (TREE_TYPE (ref));
tree range_min, range_max, min, max;
range_min = TYPE_MIN_VALUE (domain_type);
range_max = TYPE_MAX_VALUE (domain_type);
if (!range_min
|| !range_max
|| TREE_CODE (range_min) != INTEGER_CST
|| TREE_CODE (range_max) != INTEGER_CST)
return false;
min = array_ref_low_bound (ref);
max = array_ref_up_bound (ref);
if (!min
|| !max
|| TREE_CODE (min) != INTEGER_CST
|| TREE_CODE (max) != INTEGER_CST)
return false;
if (tree_int_cst_lt (range_min, min)
|| tree_int_cst_lt (max, range_max))
return false;
return true;
} | [
"static",
"bool",
"range_in_array_bounds_p",
"(",
"tree",
"ref",
")",
"{",
"tree",
"domain_type",
"=",
"TYPE_DOMAIN",
"(",
"TREE_TYPE",
"(",
"ref",
")",
")",
";",
"tree",
"range_min",
",",
"range_max",
",",
"min",
",",
"max",
";",
"range_min",
"=",
"TYPE_MIN_VALUE",
"(",
"domain_type",
")",
";",
"range_max",
"=",
"TYPE_MAX_VALUE",
"(",
"domain_type",
")",
";",
"if",
"(",
"!",
"range_min",
"||",
"!",
"range_max",
"||",
"TREE_CODE",
"(",
"range_min",
")",
"!=",
"INTEGER_CST",
"||",
"TREE_CODE",
"(",
"range_max",
")",
"!=",
"INTEGER_CST",
")",
"return",
"false",
";",
"min",
"=",
"array_ref_low_bound",
"(",
"ref",
")",
";",
"max",
"=",
"array_ref_up_bound",
"(",
"ref",
")",
";",
"if",
"(",
"!",
"min",
"||",
"!",
"max",
"||",
"TREE_CODE",
"(",
"min",
")",
"!=",
"INTEGER_CST",
"||",
"TREE_CODE",
"(",
"max",
")",
"!=",
"INTEGER_CST",
")",
"return",
"false",
";",
"if",
"(",
"tree_int_cst_lt",
"(",
"range_min",
",",
"min",
")",
"||",
"tree_int_cst_lt",
"(",
"max",
",",
"range_max",
")",
")",
"return",
"false",
";",
"return",
"true",
";",
"}"
] | Returns true if it is possible to prove that the range of
an array access REF (an ARRAY_RANGE_REF expression) falls
into the array bounds. | [
"Returns",
"true",
"if",
"it",
"is",
"possible",
"to",
"prove",
"that",
"the",
"range",
"of",
"an",
"array",
"access",
"REF",
"(",
"an",
"ARRAY_RANGE_REF",
"expression",
")",
"falls",
"into",
"the",
"array",
"bounds",
"."
] | [] | [
{
"param": "ref",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ref",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | find_trapping_overflow | tree | static tree
find_trapping_overflow (tree *tp, int *walk_subtrees, void *data)
{
if (EXPR_P (*tp)
&& ANY_INTEGRAL_TYPE_P (TREE_TYPE (*tp))
&& !operation_no_trapping_overflow (TREE_TYPE (*tp), TREE_CODE (*tp)))
return *tp;
if (IS_TYPE_OR_DECL_P (*tp)
|| (TREE_CODE (*tp) == SAVE_EXPR && data == NULL))
*walk_subtrees = 0;
return NULL_TREE;
} | /* Return non-NULL if there is an integer operation with trapping overflow
we can rewrite into non-trapping. Called via walk_tree from
rewrite_to_non_trapping_overflow. */ | Return non-NULL if there is an integer operation with trapping overflow
we can rewrite into non-trapping. | [
"Return",
"non",
"-",
"NULL",
"if",
"there",
"is",
"an",
"integer",
"operation",
"with",
"trapping",
"overflow",
"we",
"can",
"rewrite",
"into",
"non",
"-",
"trapping",
"."
] | static tree
find_trapping_overflow (tree *tp, int *walk_subtrees, void *data)
{
if (EXPR_P (*tp)
&& ANY_INTEGRAL_TYPE_P (TREE_TYPE (*tp))
&& !operation_no_trapping_overflow (TREE_TYPE (*tp), TREE_CODE (*tp)))
return *tp;
if (IS_TYPE_OR_DECL_P (*tp)
|| (TREE_CODE (*tp) == SAVE_EXPR && data == NULL))
*walk_subtrees = 0;
return NULL_TREE;
} | [
"static",
"tree",
"find_trapping_overflow",
"(",
"tree",
"*",
"tp",
",",
"int",
"*",
"walk_subtrees",
",",
"void",
"*",
"data",
")",
"{",
"if",
"(",
"EXPR_P",
"(",
"*",
"tp",
")",
"&&",
"ANY_INTEGRAL_TYPE_P",
"(",
"TREE_TYPE",
"(",
"*",
"tp",
")",
")",
"&&",
"!",
"operation_no_trapping_overflow",
"(",
"TREE_TYPE",
"(",
"*",
"tp",
")",
",",
"TREE_CODE",
"(",
"*",
"tp",
")",
")",
")",
"return",
"*",
"tp",
";",
"if",
"(",
"IS_TYPE_OR_DECL_P",
"(",
"*",
"tp",
")",
"||",
"(",
"TREE_CODE",
"(",
"*",
"tp",
")",
"==",
"SAVE_EXPR",
"&&",
"data",
"==",
"NULL",
")",
")",
"*",
"walk_subtrees",
"=",
"0",
";",
"return",
"NULL_TREE",
";",
"}"
] | Return non-NULL if there is an integer operation with trapping overflow
we can rewrite into non-trapping. | [
"Return",
"non",
"-",
"NULL",
"if",
"there",
"is",
"an",
"integer",
"operation",
"with",
"trapping",
"overflow",
"we",
"can",
"rewrite",
"into",
"non",
"-",
"trapping",
"."
] | [] | [
{
"param": "tp",
"type": "tree"
},
{
"param": "walk_subtrees",
"type": "int"
},
{
"param": "data",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tp",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "walk_subtrees",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | rewrite_to_non_trapping_overflow | tree | tree
rewrite_to_non_trapping_overflow (tree expr)
{
if (!flag_trapv)
return expr;
hash_set<tree> pset;
if (!walk_tree (&expr, find_trapping_overflow, &pset, &pset))
return expr;
expr = unshare_expr (expr);
pset.empty ();
walk_tree (&expr, replace_trapping_overflow, &pset, &pset);
return expr;
} | /* If any subexpression of EXPR can trap due to -ftrapv, rewrite it
using unsigned arithmetics to avoid traps in it. */ | If any subexpression of EXPR can trap due to -ftrapv, rewrite it
using unsigned arithmetics to avoid traps in it. | [
"If",
"any",
"subexpression",
"of",
"EXPR",
"can",
"trap",
"due",
"to",
"-",
"ftrapv",
"rewrite",
"it",
"using",
"unsigned",
"arithmetics",
"to",
"avoid",
"traps",
"in",
"it",
"."
] | tree
rewrite_to_non_trapping_overflow (tree expr)
{
if (!flag_trapv)
return expr;
hash_set<tree> pset;
if (!walk_tree (&expr, find_trapping_overflow, &pset, &pset))
return expr;
expr = unshare_expr (expr);
pset.empty ();
walk_tree (&expr, replace_trapping_overflow, &pset, &pset);
return expr;
} | [
"tree",
"rewrite_to_non_trapping_overflow",
"(",
"tree",
"expr",
")",
"{",
"if",
"(",
"!",
"flag_trapv",
")",
"return",
"expr",
";",
"hash_set",
"<",
"tree",
">",
"pset",
";",
"if",
"(",
"!",
"walk_tree",
"(",
"&",
"expr",
",",
"find_trapping_overflow",
",",
"&",
"pset",
",",
"&",
"pset",
")",
")",
"return",
"expr",
";",
"expr",
"=",
"unshare_expr",
"(",
"expr",
")",
";",
"pset",
".",
"empty",
"(",
")",
";",
"walk_tree",
"(",
"&",
"expr",
",",
"replace_trapping_overflow",
",",
"&",
"pset",
",",
"&",
"pset",
")",
";",
"return",
"expr",
";",
"}"
] | If any subexpression of EXPR can trap due to -ftrapv, rewrite it
using unsigned arithmetics to avoid traps in it. | [
"If",
"any",
"subexpression",
"of",
"EXPR",
"can",
"trap",
"due",
"to",
"-",
"ftrapv",
"rewrite",
"it",
"using",
"unsigned",
"arithmetics",
"to",
"avoid",
"traps",
"in",
"it",
"."
] | [] | [
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | tree_could_throw_p | bool | bool
tree_could_throw_p (tree t)
{
if (!flag_exceptions)
return false;
if (TREE_CODE (t) == MODIFY_EXPR)
{
if (cfun->can_throw_non_call_exceptions
&& tree_could_trap_p (TREE_OPERAND (t, 0)))
return true;
t = TREE_OPERAND (t, 1);
}
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == CALL_EXPR)
return (call_expr_flags (t) & ECF_NOTHROW) == 0;
if (cfun->can_throw_non_call_exceptions)
return tree_could_trap_p (t);
return false;
} | /* Return true if expression T could throw an exception. */ | Return true if expression T could throw an exception. | [
"Return",
"true",
"if",
"expression",
"T",
"could",
"throw",
"an",
"exception",
"."
] | bool
tree_could_throw_p (tree t)
{
if (!flag_exceptions)
return false;
if (TREE_CODE (t) == MODIFY_EXPR)
{
if (cfun->can_throw_non_call_exceptions
&& tree_could_trap_p (TREE_OPERAND (t, 0)))
return true;
t = TREE_OPERAND (t, 1);
}
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == CALL_EXPR)
return (call_expr_flags (t) & ECF_NOTHROW) == 0;
if (cfun->can_throw_non_call_exceptions)
return tree_could_trap_p (t);
return false;
} | [
"bool",
"tree_could_throw_p",
"(",
"tree",
"t",
")",
"{",
"if",
"(",
"!",
"flag_exceptions",
")",
"return",
"false",
";",
"if",
"(",
"TREE_CODE",
"(",
"t",
")",
"==",
"MODIFY_EXPR",
")",
"{",
"if",
"(",
"cfun",
"->",
"can_throw_non_call_exceptions",
"&&",
"tree_could_trap_p",
"(",
"TREE_OPERAND",
"(",
"t",
",",
"0",
")",
")",
")",
"return",
"true",
";",
"t",
"=",
"TREE_OPERAND",
"(",
"t",
",",
"1",
")",
";",
"}",
"if",
"(",
"TREE_CODE",
"(",
"t",
")",
"==",
"WITH_SIZE_EXPR",
")",
"t",
"=",
"TREE_OPERAND",
"(",
"t",
",",
"0",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"t",
")",
"==",
"CALL_EXPR",
")",
"return",
"(",
"call_expr_flags",
"(",
"t",
")",
"&",
"ECF_NOTHROW",
")",
"==",
"0",
";",
"if",
"(",
"cfun",
"->",
"can_throw_non_call_exceptions",
")",
"return",
"tree_could_trap_p",
"(",
"t",
")",
";",
"return",
"false",
";",
"}"
] | Return true if expression T could throw an exception. | [
"Return",
"true",
"if",
"expression",
"T",
"could",
"throw",
"an",
"exception",
"."
] | [] | [
{
"param": "t",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "t",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | stmt_can_throw_external | bool | bool
stmt_can_throw_external (gimple *stmt)
{
int lp_nr;
if (!stmt_could_throw_p (stmt))
return false;
lp_nr = lookup_stmt_eh_lp (stmt);
return lp_nr == 0;
} | /* Return true if STMT can throw an exception that is not caught within
the current function (CFUN). */ | Return true if STMT can throw an exception that is not caught within
the current function (CFUN). | [
"Return",
"true",
"if",
"STMT",
"can",
"throw",
"an",
"exception",
"that",
"is",
"not",
"caught",
"within",
"the",
"current",
"function",
"(",
"CFUN",
")",
"."
] | bool
stmt_can_throw_external (gimple *stmt)
{
int lp_nr;
if (!stmt_could_throw_p (stmt))
return false;
lp_nr = lookup_stmt_eh_lp (stmt);
return lp_nr == 0;
} | [
"bool",
"stmt_can_throw_external",
"(",
"gimple",
"*",
"stmt",
")",
"{",
"int",
"lp_nr",
";",
"if",
"(",
"!",
"stmt_could_throw_p",
"(",
"stmt",
")",
")",
"return",
"false",
";",
"lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"stmt",
")",
";",
"return",
"lp_nr",
"==",
"0",
";",
"}"
] | Return true if STMT can throw an exception that is not caught within
the current function (CFUN). | [
"Return",
"true",
"if",
"STMT",
"can",
"throw",
"an",
"exception",
"that",
"is",
"not",
"caught",
"within",
"the",
"current",
"function",
"(",
"CFUN",
")",
"."
] | [] | [
{
"param": "stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | stmt_can_throw_internal | bool | bool
stmt_can_throw_internal (gimple *stmt)
{
int lp_nr;
if (!stmt_could_throw_p (stmt))
return false;
lp_nr = lookup_stmt_eh_lp (stmt);
return lp_nr > 0;
} | /* Return true if STMT can throw an exception that is caught within
the current function (CFUN). */ | Return true if STMT can throw an exception that is caught within
the current function (CFUN). | [
"Return",
"true",
"if",
"STMT",
"can",
"throw",
"an",
"exception",
"that",
"is",
"caught",
"within",
"the",
"current",
"function",
"(",
"CFUN",
")",
"."
] | bool
stmt_can_throw_internal (gimple *stmt)
{
int lp_nr;
if (!stmt_could_throw_p (stmt))
return false;
lp_nr = lookup_stmt_eh_lp (stmt);
return lp_nr > 0;
} | [
"bool",
"stmt_can_throw_internal",
"(",
"gimple",
"*",
"stmt",
")",
"{",
"int",
"lp_nr",
";",
"if",
"(",
"!",
"stmt_could_throw_p",
"(",
"stmt",
")",
")",
"return",
"false",
";",
"lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"stmt",
")",
";",
"return",
"lp_nr",
">",
"0",
";",
"}"
] | Return true if STMT can throw an exception that is caught within
the current function (CFUN). | [
"Return",
"true",
"if",
"STMT",
"can",
"throw",
"an",
"exception",
"that",
"is",
"caught",
"within",
"the",
"current",
"function",
"(",
"CFUN",
")",
"."
] | [] | [
{
"param": "stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | maybe_clean_eh_stmt_fn | bool | bool
maybe_clean_eh_stmt_fn (struct function *ifun, gimple *stmt)
{
if (stmt_could_throw_p (stmt))
return false;
return remove_stmt_from_eh_lp_fn (ifun, stmt);
} | /* Given a statement STMT in IFUN, if STMT can no longer throw, then
remove any entry it might have from the EH table. Return true if
any change was made. */ | Given a statement STMT in IFUN, if STMT can no longer throw, then
remove any entry it might have from the EH table. Return true if
any change was made. | [
"Given",
"a",
"statement",
"STMT",
"in",
"IFUN",
"if",
"STMT",
"can",
"no",
"longer",
"throw",
"then",
"remove",
"any",
"entry",
"it",
"might",
"have",
"from",
"the",
"EH",
"table",
".",
"Return",
"true",
"if",
"any",
"change",
"was",
"made",
"."
] | bool
maybe_clean_eh_stmt_fn (struct function *ifun, gimple *stmt)
{
if (stmt_could_throw_p (stmt))
return false;
return remove_stmt_from_eh_lp_fn (ifun, stmt);
} | [
"bool",
"maybe_clean_eh_stmt_fn",
"(",
"struct",
"function",
"*",
"ifun",
",",
"gimple",
"*",
"stmt",
")",
"{",
"if",
"(",
"stmt_could_throw_p",
"(",
"stmt",
")",
")",
"return",
"false",
";",
"return",
"remove_stmt_from_eh_lp_fn",
"(",
"ifun",
",",
"stmt",
")",
";",
"}"
] | Given a statement STMT in IFUN, if STMT can no longer throw, then
remove any entry it might have from the EH table. | [
"Given",
"a",
"statement",
"STMT",
"in",
"IFUN",
"if",
"STMT",
"can",
"no",
"longer",
"throw",
"then",
"remove",
"any",
"entry",
"it",
"might",
"have",
"from",
"the",
"EH",
"table",
"."
] | [] | [
{
"param": "ifun",
"type": "struct function"
},
{
"param": "stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ifun",
"type": "struct function",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | maybe_clean_eh_stmt | bool | bool
maybe_clean_eh_stmt (gimple *stmt)
{
return maybe_clean_eh_stmt_fn (cfun, stmt);
} | /* Likewise, but always use the current function. */ | Likewise, but always use the current function. | [
"Likewise",
"but",
"always",
"use",
"the",
"current",
"function",
"."
] | bool
maybe_clean_eh_stmt (gimple *stmt)
{
return maybe_clean_eh_stmt_fn (cfun, stmt);
} | [
"bool",
"maybe_clean_eh_stmt",
"(",
"gimple",
"*",
"stmt",
")",
"{",
"return",
"maybe_clean_eh_stmt_fn",
"(",
"cfun",
",",
"stmt",
")",
";",
"}"
] | Likewise, but always use the current function. | [
"Likewise",
"but",
"always",
"use",
"the",
"current",
"function",
"."
] | [] | [
{
"param": "stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | maybe_clean_or_replace_eh_stmt | bool | bool
maybe_clean_or_replace_eh_stmt (gimple *old_stmt, gimple *new_stmt)
{
int lp_nr = lookup_stmt_eh_lp (old_stmt);
if (lp_nr != 0)
{
bool new_stmt_could_throw = stmt_could_throw_p (new_stmt);
if (new_stmt == old_stmt && new_stmt_could_throw)
return false;
remove_stmt_from_eh_lp (old_stmt);
if (new_stmt_could_throw)
{
add_stmt_to_eh_lp (new_stmt, lp_nr);
return false;
}
else
return true;
}
return false;
} | /* Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
in the table if it should be in there. Return TRUE if a replacement was
done that my require an EH edge purge. */ | Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
in the table if it should be in there. Return TRUE if a replacement was
done that my require an EH edge purge. | [
"Given",
"a",
"statement",
"OLD_STMT",
"and",
"a",
"new",
"statement",
"NEW_STMT",
"that",
"has",
"replaced",
"OLD_STMT",
"in",
"the",
"function",
"remove",
"OLD_STMT",
"from",
"the",
"EH",
"table",
"and",
"put",
"NEW_STMT",
"in",
"the",
"table",
"if",
"it",
"should",
"be",
"in",
"there",
".",
"Return",
"TRUE",
"if",
"a",
"replacement",
"was",
"done",
"that",
"my",
"require",
"an",
"EH",
"edge",
"purge",
"."
] | bool
maybe_clean_or_replace_eh_stmt (gimple *old_stmt, gimple *new_stmt)
{
int lp_nr = lookup_stmt_eh_lp (old_stmt);
if (lp_nr != 0)
{
bool new_stmt_could_throw = stmt_could_throw_p (new_stmt);
if (new_stmt == old_stmt && new_stmt_could_throw)
return false;
remove_stmt_from_eh_lp (old_stmt);
if (new_stmt_could_throw)
{
add_stmt_to_eh_lp (new_stmt, lp_nr);
return false;
}
else
return true;
}
return false;
} | [
"bool",
"maybe_clean_or_replace_eh_stmt",
"(",
"gimple",
"*",
"old_stmt",
",",
"gimple",
"*",
"new_stmt",
")",
"{",
"int",
"lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"old_stmt",
")",
";",
"if",
"(",
"lp_nr",
"!=",
"0",
")",
"{",
"bool",
"new_stmt_could_throw",
"=",
"stmt_could_throw_p",
"(",
"new_stmt",
")",
";",
"if",
"(",
"new_stmt",
"==",
"old_stmt",
"&&",
"new_stmt_could_throw",
")",
"return",
"false",
";",
"remove_stmt_from_eh_lp",
"(",
"old_stmt",
")",
";",
"if",
"(",
"new_stmt_could_throw",
")",
"{",
"add_stmt_to_eh_lp",
"(",
"new_stmt",
",",
"lp_nr",
")",
";",
"return",
"false",
";",
"}",
"else",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
in the table if it should be in there. | [
"Given",
"a",
"statement",
"OLD_STMT",
"and",
"a",
"new",
"statement",
"NEW_STMT",
"that",
"has",
"replaced",
"OLD_STMT",
"in",
"the",
"function",
"remove",
"OLD_STMT",
"from",
"the",
"EH",
"table",
"and",
"put",
"NEW_STMT",
"in",
"the",
"table",
"if",
"it",
"should",
"be",
"in",
"there",
"."
] | [] | [
{
"param": "old_stmt",
"type": "gimple"
},
{
"param": "new_stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "old_stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "new_stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | maybe_duplicate_eh_stmt | bool | bool
maybe_duplicate_eh_stmt (gimple *new_stmt, gimple *old_stmt)
{
int lp_nr;
if (!stmt_could_throw_p (new_stmt))
return false;
lp_nr = lookup_stmt_eh_lp (old_stmt);
if (lp_nr == 0)
return false;
add_stmt_to_eh_lp (new_stmt, lp_nr);
return true;
} | /* Similar, but both OLD_STMT and NEW_STMT are within the current function,
and thus no remapping is required. */ | Similar, but both OLD_STMT and NEW_STMT are within the current function,
and thus no remapping is required. | [
"Similar",
"but",
"both",
"OLD_STMT",
"and",
"NEW_STMT",
"are",
"within",
"the",
"current",
"function",
"and",
"thus",
"no",
"remapping",
"is",
"required",
"."
] | bool
maybe_duplicate_eh_stmt (gimple *new_stmt, gimple *old_stmt)
{
int lp_nr;
if (!stmt_could_throw_p (new_stmt))
return false;
lp_nr = lookup_stmt_eh_lp (old_stmt);
if (lp_nr == 0)
return false;
add_stmt_to_eh_lp (new_stmt, lp_nr);
return true;
} | [
"bool",
"maybe_duplicate_eh_stmt",
"(",
"gimple",
"*",
"new_stmt",
",",
"gimple",
"*",
"old_stmt",
")",
"{",
"int",
"lp_nr",
";",
"if",
"(",
"!",
"stmt_could_throw_p",
"(",
"new_stmt",
")",
")",
"return",
"false",
";",
"lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"old_stmt",
")",
";",
"if",
"(",
"lp_nr",
"==",
"0",
")",
"return",
"false",
";",
"add_stmt_to_eh_lp",
"(",
"new_stmt",
",",
"lp_nr",
")",
";",
"return",
"true",
";",
"}"
] | Similar, but both OLD_STMT and NEW_STMT are within the current function,
and thus no remapping is required. | [
"Similar",
"but",
"both",
"OLD_STMT",
"and",
"NEW_STMT",
"are",
"within",
"the",
"current",
"function",
"and",
"thus",
"no",
"remapping",
"is",
"required",
"."
] | [] | [
{
"param": "new_stmt",
"type": "gimple"
},
{
"param": "old_stmt",
"type": "gimple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "new_stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "old_stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | same_handler_p | bool | static bool
same_handler_p (gimple_seq oneh, gimple_seq twoh)
{
gimple_stmt_iterator gsi;
gimple *ones, *twos;
unsigned int ai;
gsi = gsi_start (oneh);
if (!gsi_one_before_end_p (gsi))
return false;
ones = gsi_stmt (gsi);
gsi = gsi_start (twoh);
if (!gsi_one_before_end_p (gsi))
return false;
twos = gsi_stmt (gsi);
if (!is_gimple_call (ones)
|| !is_gimple_call (twos)
|| gimple_call_lhs (ones)
|| gimple_call_lhs (twos)
|| gimple_call_chain (ones)
|| gimple_call_chain (twos)
|| !gimple_call_same_target_p (ones, twos)
|| gimple_call_num_args (ones) != gimple_call_num_args (twos))
return false;
for (ai = 0; ai < gimple_call_num_args (ones); ++ai)
if (!operand_equal_p (gimple_call_arg (ones, ai),
gimple_call_arg (twos, ai), 0))
return false;
return true;
} | /* Returns TRUE if oneh and twoh are exception handlers (gimple_try_cleanup of
GIMPLE_TRY) that are similar enough to be considered the same. Currently
this only handles handlers consisting of a single call, as that's the
important case for C++: a destructor call for a particular object showing
up in multiple handlers. */ | Returns TRUE if oneh and twoh are exception handlers (gimple_try_cleanup of
GIMPLE_TRY) that are similar enough to be considered the same. Currently
this only handles handlers consisting of a single call, as that's the
important case for C++: a destructor call for a particular object showing
up in multiple handlers. | [
"Returns",
"TRUE",
"if",
"oneh",
"and",
"twoh",
"are",
"exception",
"handlers",
"(",
"gimple_try_cleanup",
"of",
"GIMPLE_TRY",
")",
"that",
"are",
"similar",
"enough",
"to",
"be",
"considered",
"the",
"same",
".",
"Currently",
"this",
"only",
"handles",
"handlers",
"consisting",
"of",
"a",
"single",
"call",
"as",
"that",
"'",
"s",
"the",
"important",
"case",
"for",
"C",
"++",
":",
"a",
"destructor",
"call",
"for",
"a",
"particular",
"object",
"showing",
"up",
"in",
"multiple",
"handlers",
"."
] | static bool
same_handler_p (gimple_seq oneh, gimple_seq twoh)
{
gimple_stmt_iterator gsi;
gimple *ones, *twos;
unsigned int ai;
gsi = gsi_start (oneh);
if (!gsi_one_before_end_p (gsi))
return false;
ones = gsi_stmt (gsi);
gsi = gsi_start (twoh);
if (!gsi_one_before_end_p (gsi))
return false;
twos = gsi_stmt (gsi);
if (!is_gimple_call (ones)
|| !is_gimple_call (twos)
|| gimple_call_lhs (ones)
|| gimple_call_lhs (twos)
|| gimple_call_chain (ones)
|| gimple_call_chain (twos)
|| !gimple_call_same_target_p (ones, twos)
|| gimple_call_num_args (ones) != gimple_call_num_args (twos))
return false;
for (ai = 0; ai < gimple_call_num_args (ones); ++ai)
if (!operand_equal_p (gimple_call_arg (ones, ai),
gimple_call_arg (twos, ai), 0))
return false;
return true;
} | [
"static",
"bool",
"same_handler_p",
"(",
"gimple_seq",
"oneh",
",",
"gimple_seq",
"twoh",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"gimple",
"*",
"ones",
",",
"*",
"twos",
";",
"unsigned",
"int",
"ai",
";",
"gsi",
"=",
"gsi_start",
"(",
"oneh",
")",
";",
"if",
"(",
"!",
"gsi_one_before_end_p",
"(",
"gsi",
")",
")",
"return",
"false",
";",
"ones",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"gsi",
"=",
"gsi_start",
"(",
"twoh",
")",
";",
"if",
"(",
"!",
"gsi_one_before_end_p",
"(",
"gsi",
")",
")",
"return",
"false",
";",
"twos",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"!",
"is_gimple_call",
"(",
"ones",
")",
"||",
"!",
"is_gimple_call",
"(",
"twos",
")",
"||",
"gimple_call_lhs",
"(",
"ones",
")",
"||",
"gimple_call_lhs",
"(",
"twos",
")",
"||",
"gimple_call_chain",
"(",
"ones",
")",
"||",
"gimple_call_chain",
"(",
"twos",
")",
"||",
"!",
"gimple_call_same_target_p",
"(",
"ones",
",",
"twos",
")",
"||",
"gimple_call_num_args",
"(",
"ones",
")",
"!=",
"gimple_call_num_args",
"(",
"twos",
")",
")",
"return",
"false",
";",
"for",
"(",
"ai",
"=",
"0",
";",
"ai",
"<",
"gimple_call_num_args",
"(",
"ones",
")",
";",
"++",
"ai",
")",
"if",
"(",
"!",
"operand_equal_p",
"(",
"gimple_call_arg",
"(",
"ones",
",",
"ai",
")",
",",
"gimple_call_arg",
"(",
"twos",
",",
"ai",
")",
",",
"0",
")",
")",
"return",
"false",
";",
"return",
"true",
";",
"}"
] | Returns TRUE if oneh and twoh are exception handlers (gimple_try_cleanup of
GIMPLE_TRY) that are similar enough to be considered the same. | [
"Returns",
"TRUE",
"if",
"oneh",
"and",
"twoh",
"are",
"exception",
"handlers",
"(",
"gimple_try_cleanup",
"of",
"GIMPLE_TRY",
")",
"that",
"are",
"similar",
"enough",
"to",
"be",
"considered",
"the",
"same",
"."
] | [] | [
{
"param": "oneh",
"type": "gimple_seq"
},
{
"param": "twoh",
"type": "gimple_seq"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "oneh",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "twoh",
"type": "gimple_seq",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | lower_eh_dispatch | bool | static bool
lower_eh_dispatch (basic_block src, geh_dispatch *stmt)
{
gimple_stmt_iterator gsi;
int region_nr;
eh_region r;
tree filter, fn;
gimple *x;
bool redirected = false;
region_nr = gimple_eh_dispatch_region (stmt);
r = get_eh_region_from_number (region_nr);
gsi = gsi_last_bb (src);
switch (r->type)
{
case ERT_TRY:
{
auto_vec<tree> labels;
tree default_label = NULL;
eh_catch c;
edge_iterator ei;
edge e;
hash_set<tree> seen_values;
/* Collect the labels for a switch. Zero the post_landing_pad
field becase we'll no longer have anything keeping these labels
in existence and the optimizer will be free to merge these
blocks at will. */
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
tree tp_node, flt_node, lab = c->label;
bool have_label = false;
c->label = NULL;
tp_node = c->type_list;
flt_node = c->filter_list;
if (tp_node == NULL)
{
default_label = lab;
break;
}
do
{
/* Filter out duplicate labels that arise when this handler
is shadowed by an earlier one. When no labels are
attached to the handler anymore, we remove
the corresponding edge and then we delete unreachable
blocks at the end of this pass. */
if (! seen_values.contains (TREE_VALUE (flt_node)))
{
tree t = build_case_label (TREE_VALUE (flt_node),
NULL, lab);
labels.safe_push (t);
seen_values.add (TREE_VALUE (flt_node));
have_label = true;
}
tp_node = TREE_CHAIN (tp_node);
flt_node = TREE_CHAIN (flt_node);
}
while (tp_node);
if (! have_label)
{
remove_edge (find_edge (src, label_to_block (lab)));
redirected = true;
}
}
/* Clean up the edge flags. */
FOR_EACH_EDGE (e, ei, src->succs)
{
if (e->flags & EDGE_FALLTHRU)
{
/* If there was no catch-all, use the fallthru edge. */
if (default_label == NULL)
default_label = gimple_block_label (e->dest);
e->flags &= ~EDGE_FALLTHRU;
}
}
gcc_assert (default_label != NULL);
/* Don't generate a switch if there's only a default case.
This is common in the form of try { A; } catch (...) { B; }. */
if (!labels.exists ())
{
e = single_succ_edge (src);
e->flags |= EDGE_FALLTHRU;
}
else
{
fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
region_nr));
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)));
filter = make_ssa_name (filter, x);
gimple_call_set_lhs (x, filter);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
/* Turn the default label into a default case. */
default_label = build_case_label (NULL, NULL, default_label);
sort_case_labels (labels);
x = gimple_build_switch (filter, default_label, labels);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
}
}
break;
case ERT_ALLOWED_EXCEPTIONS:
{
edge b_e = BRANCH_EDGE (src);
edge f_e = FALLTHRU_EDGE (src);
fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
region_nr));
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)));
filter = make_ssa_name (filter, x);
gimple_call_set_lhs (x, filter);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
r->u.allowed.label = NULL;
x = gimple_build_cond (EQ_EXPR, filter,
build_int_cst (TREE_TYPE (filter),
r->u.allowed.filter),
NULL_TREE, NULL_TREE);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
b_e->flags = b_e->flags | EDGE_TRUE_VALUE;
f_e->flags = (f_e->flags & ~EDGE_FALLTHRU) | EDGE_FALSE_VALUE;
}
break;
default:
gcc_unreachable ();
}
/* Replace the EH_DISPATCH with the SWITCH or COND generated above. */
gsi_remove (&gsi, true);
return redirected;
} | /* At the end of inlining, we can lower EH_DISPATCH. Return true when
we have found some duplicate labels and removed some edges. */ | At the end of inlining, we can lower EH_DISPATCH. Return true when
we have found some duplicate labels and removed some edges. | [
"At",
"the",
"end",
"of",
"inlining",
"we",
"can",
"lower",
"EH_DISPATCH",
".",
"Return",
"true",
"when",
"we",
"have",
"found",
"some",
"duplicate",
"labels",
"and",
"removed",
"some",
"edges",
"."
] | static bool
lower_eh_dispatch (basic_block src, geh_dispatch *stmt)
{
gimple_stmt_iterator gsi;
int region_nr;
eh_region r;
tree filter, fn;
gimple *x;
bool redirected = false;
region_nr = gimple_eh_dispatch_region (stmt);
r = get_eh_region_from_number (region_nr);
gsi = gsi_last_bb (src);
switch (r->type)
{
case ERT_TRY:
{
auto_vec<tree> labels;
tree default_label = NULL;
eh_catch c;
edge_iterator ei;
edge e;
hash_set<tree> seen_values;
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
{
tree tp_node, flt_node, lab = c->label;
bool have_label = false;
c->label = NULL;
tp_node = c->type_list;
flt_node = c->filter_list;
if (tp_node == NULL)
{
default_label = lab;
break;
}
do
{
if (! seen_values.contains (TREE_VALUE (flt_node)))
{
tree t = build_case_label (TREE_VALUE (flt_node),
NULL, lab);
labels.safe_push (t);
seen_values.add (TREE_VALUE (flt_node));
have_label = true;
}
tp_node = TREE_CHAIN (tp_node);
flt_node = TREE_CHAIN (flt_node);
}
while (tp_node);
if (! have_label)
{
remove_edge (find_edge (src, label_to_block (lab)));
redirected = true;
}
}
FOR_EACH_EDGE (e, ei, src->succs)
{
if (e->flags & EDGE_FALLTHRU)
{
if (default_label == NULL)
default_label = gimple_block_label (e->dest);
e->flags &= ~EDGE_FALLTHRU;
}
}
gcc_assert (default_label != NULL);
if (!labels.exists ())
{
e = single_succ_edge (src);
e->flags |= EDGE_FALLTHRU;
}
else
{
fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
region_nr));
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)));
filter = make_ssa_name (filter, x);
gimple_call_set_lhs (x, filter);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
default_label = build_case_label (NULL, NULL, default_label);
sort_case_labels (labels);
x = gimple_build_switch (filter, default_label, labels);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
}
}
break;
case ERT_ALLOWED_EXCEPTIONS:
{
edge b_e = BRANCH_EDGE (src);
edge f_e = FALLTHRU_EDGE (src);
fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
region_nr));
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)));
filter = make_ssa_name (filter, x);
gimple_call_set_lhs (x, filter);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
r->u.allowed.label = NULL;
x = gimple_build_cond (EQ_EXPR, filter,
build_int_cst (TREE_TYPE (filter),
r->u.allowed.filter),
NULL_TREE, NULL_TREE);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
b_e->flags = b_e->flags | EDGE_TRUE_VALUE;
f_e->flags = (f_e->flags & ~EDGE_FALLTHRU) | EDGE_FALSE_VALUE;
}
break;
default:
gcc_unreachable ();
}
gsi_remove (&gsi, true);
return redirected;
} | [
"static",
"bool",
"lower_eh_dispatch",
"(",
"basic_block",
"src",
",",
"geh_dispatch",
"*",
"stmt",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"int",
"region_nr",
";",
"eh_region",
"r",
";",
"tree",
"filter",
",",
"fn",
";",
"gimple",
"*",
"x",
";",
"bool",
"redirected",
"=",
"false",
";",
"region_nr",
"=",
"gimple_eh_dispatch_region",
"(",
"stmt",
")",
";",
"r",
"=",
"get_eh_region_from_number",
"(",
"region_nr",
")",
";",
"gsi",
"=",
"gsi_last_bb",
"(",
"src",
")",
";",
"switch",
"(",
"r",
"->",
"type",
")",
"{",
"case",
"ERT_TRY",
":",
"{",
"auto_vec",
"<",
"tree",
">",
"labels",
";",
"tree",
"default_label",
"=",
"NULL",
";",
"eh_catch",
"c",
";",
"edge_iterator",
"ei",
";",
"edge",
"e",
";",
"hash_set",
"<",
"tree",
">",
"seen_values",
";",
"for",
"(",
"c",
"=",
"r",
"->",
"u",
".",
"eh_try",
".",
"first_catch",
";",
"c",
";",
"c",
"=",
"c",
"->",
"next_catch",
")",
"{",
"tree",
"tp_node",
",",
"flt_node",
",",
"lab",
"=",
"c",
"->",
"label",
";",
"bool",
"have_label",
"=",
"false",
";",
"c",
"->",
"label",
"=",
"NULL",
";",
"tp_node",
"=",
"c",
"->",
"type_list",
";",
"flt_node",
"=",
"c",
"->",
"filter_list",
";",
"if",
"(",
"tp_node",
"==",
"NULL",
")",
"{",
"default_label",
"=",
"lab",
";",
"break",
";",
"}",
"do",
"{",
"if",
"(",
"!",
"seen_values",
".",
"contains",
"(",
"TREE_VALUE",
"(",
"flt_node",
")",
")",
")",
"{",
"tree",
"t",
"=",
"build_case_label",
"(",
"TREE_VALUE",
"(",
"flt_node",
")",
",",
"NULL",
",",
"lab",
")",
";",
"labels",
".",
"safe_push",
"(",
"t",
")",
";",
"seen_values",
".",
"add",
"(",
"TREE_VALUE",
"(",
"flt_node",
")",
")",
";",
"have_label",
"=",
"true",
";",
"}",
"tp_node",
"=",
"TREE_CHAIN",
"(",
"tp_node",
")",
";",
"flt_node",
"=",
"TREE_CHAIN",
"(",
"flt_node",
")",
";",
"}",
"while",
"(",
"tp_node",
")",
";",
"if",
"(",
"!",
"have_label",
")",
"{",
"remove_edge",
"(",
"find_edge",
"(",
"src",
",",
"label_to_block",
"(",
"lab",
")",
")",
")",
";",
"redirected",
"=",
"true",
";",
"}",
"}",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"src",
"->",
"succs",
")",
"",
"{",
"if",
"(",
"e",
"->",
"flags",
"&",
"EDGE_FALLTHRU",
")",
"{",
"if",
"(",
"default_label",
"==",
"NULL",
")",
"default_label",
"=",
"gimple_block_label",
"(",
"e",
"->",
"dest",
")",
";",
"e",
"->",
"flags",
"&=",
"~",
"EDGE_FALLTHRU",
";",
"}",
"}",
"gcc_assert",
"(",
"default_label",
"!=",
"NULL",
")",
";",
"if",
"(",
"!",
"labels",
".",
"exists",
"(",
")",
")",
"{",
"e",
"=",
"single_succ_edge",
"(",
"src",
")",
";",
"e",
"->",
"flags",
"|=",
"EDGE_FALLTHRU",
";",
"}",
"else",
"{",
"fn",
"=",
"builtin_decl_implicit",
"(",
"BUILT_IN_EH_FILTER",
")",
";",
"x",
"=",
"gimple_build_call",
"(",
"fn",
",",
"1",
",",
"build_int_cst",
"(",
"integer_type_node",
",",
"region_nr",
")",
")",
";",
"filter",
"=",
"create_tmp_var",
"(",
"TREE_TYPE",
"(",
"TREE_TYPE",
"(",
"fn",
")",
")",
")",
";",
"filter",
"=",
"make_ssa_name",
"(",
"filter",
",",
"x",
")",
";",
"gimple_call_set_lhs",
"(",
"x",
",",
"filter",
")",
";",
"gsi_insert_before",
"(",
"&",
"gsi",
",",
"x",
",",
"GSI_SAME_STMT",
")",
";",
"default_label",
"=",
"build_case_label",
"(",
"NULL",
",",
"NULL",
",",
"default_label",
")",
";",
"sort_case_labels",
"(",
"labels",
")",
";",
"x",
"=",
"gimple_build_switch",
"(",
"filter",
",",
"default_label",
",",
"labels",
")",
";",
"gsi_insert_before",
"(",
"&",
"gsi",
",",
"x",
",",
"GSI_SAME_STMT",
")",
";",
"}",
"}",
"break",
";",
"case",
"ERT_ALLOWED_EXCEPTIONS",
":",
"{",
"edge",
"b_e",
"=",
"BRANCH_EDGE",
"(",
"src",
")",
";",
"edge",
"f_e",
"=",
"FALLTHRU_EDGE",
"(",
"src",
")",
";",
"fn",
"=",
"builtin_decl_implicit",
"(",
"BUILT_IN_EH_FILTER",
")",
";",
"x",
"=",
"gimple_build_call",
"(",
"fn",
",",
"1",
",",
"build_int_cst",
"(",
"integer_type_node",
",",
"region_nr",
")",
")",
";",
"filter",
"=",
"create_tmp_var",
"(",
"TREE_TYPE",
"(",
"TREE_TYPE",
"(",
"fn",
")",
")",
")",
";",
"filter",
"=",
"make_ssa_name",
"(",
"filter",
",",
"x",
")",
";",
"gimple_call_set_lhs",
"(",
"x",
",",
"filter",
")",
";",
"gsi_insert_before",
"(",
"&",
"gsi",
",",
"x",
",",
"GSI_SAME_STMT",
")",
";",
"r",
"->",
"u",
".",
"allowed",
".",
"label",
"=",
"NULL",
";",
"x",
"=",
"gimple_build_cond",
"(",
"EQ_EXPR",
",",
"filter",
",",
"build_int_cst",
"(",
"TREE_TYPE",
"(",
"filter",
")",
",",
"r",
"->",
"u",
".",
"allowed",
".",
"filter",
")",
",",
"NULL_TREE",
",",
"NULL_TREE",
")",
";",
"gsi_insert_before",
"(",
"&",
"gsi",
",",
"x",
",",
"GSI_SAME_STMT",
")",
";",
"b_e",
"->",
"flags",
"=",
"b_e",
"->",
"flags",
"|",
"EDGE_TRUE_VALUE",
";",
"f_e",
"->",
"flags",
"=",
"(",
"f_e",
"->",
"flags",
"&",
"~",
"EDGE_FALLTHRU",
")",
"|",
"EDGE_FALSE_VALUE",
";",
"}",
"break",
";",
"default",
":",
"gcc_unreachable",
"(",
")",
";",
"}",
"gsi_remove",
"(",
"&",
"gsi",
",",
"true",
")",
";",
"return",
"redirected",
";",
"}"
] | At the end of inlining, we can lower EH_DISPATCH. | [
"At",
"the",
"end",
"of",
"inlining",
"we",
"can",
"lower",
"EH_DISPATCH",
"."
] | [
"/* Collect the labels for a switch. Zero the post_landing_pad\n\t field becase we'll no longer have anything keeping these labels\n\t in existence and the optimizer will be free to merge these\n\t blocks at will. */",
"/* Filter out duplicate labels that arise when this handler \n\t\t is shadowed by an earlier one. When no labels are \n\t\t attached to the handler anymore, we remove \n\t\t the corresponding edge and then we delete unreachable \n\t\t blocks at the end of this pass. */",
"/* Clean up the edge flags. */",
"/* If there was no catch-all, use the fallthru edge. */",
"/* Don't generate a switch if there's only a default case.\n\t This is common in the form of try { A; } catch (...) { B; }. */",
"/* Turn the default label into a default case. */",
"/* Replace the EH_DISPATCH with the SWITCH or COND generated above. */"
] | [
{
"param": "src",
"type": "basic_block"
},
{
"param": "stmt",
"type": "geh_dispatch"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "src",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "stmt",
"type": "geh_dispatch",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | remove_unreachable_handlers | void | static void
remove_unreachable_handlers (void)
{
sbitmap r_reachable, lp_reachable;
eh_region region;
eh_landing_pad lp;
unsigned i;
mark_reachable_handlers (&r_reachable, &lp_reachable);
if (dump_file)
{
fprintf (dump_file, "Before removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "Reachable regions: ");
dump_bitmap_file (dump_file, r_reachable);
fprintf (dump_file, "Reachable landing pads: ");
dump_bitmap_file (dump_file, lp_reachable);
}
if (dump_file)
{
FOR_EACH_VEC_SAFE_ELT (cfun->eh->region_array, i, region)
if (region && !bitmap_bit_p (r_reachable, region->index))
fprintf (dump_file,
"Removing unreachable region %d\n",
region->index);
}
remove_unreachable_eh_regions (r_reachable);
FOR_EACH_VEC_SAFE_ELT (cfun->eh->lp_array, i, lp)
if (lp && !bitmap_bit_p (lp_reachable, lp->index))
{
if (dump_file)
fprintf (dump_file,
"Removing unreachable landing pad %d\n",
lp->index);
remove_eh_landing_pad (lp);
}
if (dump_file)
{
fprintf (dump_file, "\n\nAfter removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "\n\n");
}
sbitmap_free (r_reachable);
sbitmap_free (lp_reachable);
if (flag_checking)
verify_eh_tree (cfun);
} | /* Remove unreachable handlers and unreachable landing pads. */ | Remove unreachable handlers and unreachable landing pads. | [
"Remove",
"unreachable",
"handlers",
"and",
"unreachable",
"landing",
"pads",
"."
] | static void
remove_unreachable_handlers (void)
{
sbitmap r_reachable, lp_reachable;
eh_region region;
eh_landing_pad lp;
unsigned i;
mark_reachable_handlers (&r_reachable, &lp_reachable);
if (dump_file)
{
fprintf (dump_file, "Before removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "Reachable regions: ");
dump_bitmap_file (dump_file, r_reachable);
fprintf (dump_file, "Reachable landing pads: ");
dump_bitmap_file (dump_file, lp_reachable);
}
if (dump_file)
{
FOR_EACH_VEC_SAFE_ELT (cfun->eh->region_array, i, region)
if (region && !bitmap_bit_p (r_reachable, region->index))
fprintf (dump_file,
"Removing unreachable region %d\n",
region->index);
}
remove_unreachable_eh_regions (r_reachable);
FOR_EACH_VEC_SAFE_ELT (cfun->eh->lp_array, i, lp)
if (lp && !bitmap_bit_p (lp_reachable, lp->index))
{
if (dump_file)
fprintf (dump_file,
"Removing unreachable landing pad %d\n",
lp->index);
remove_eh_landing_pad (lp);
}
if (dump_file)
{
fprintf (dump_file, "\n\nAfter removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "\n\n");
}
sbitmap_free (r_reachable);
sbitmap_free (lp_reachable);
if (flag_checking)
verify_eh_tree (cfun);
} | [
"static",
"void",
"remove_unreachable_handlers",
"(",
"void",
")",
"{",
"sbitmap",
"r_reachable",
",",
"lp_reachable",
";",
"eh_region",
"region",
";",
"eh_landing_pad",
"lp",
";",
"unsigned",
"i",
";",
"mark_reachable_handlers",
"(",
"&",
"r_reachable",
",",
"&",
"lp_reachable",
")",
";",
"if",
"(",
"dump_file",
")",
"{",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
")",
";",
"dump_eh_tree",
"(",
"dump_file",
",",
"cfun",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"dump_bitmap_file",
"(",
"dump_file",
",",
"r_reachable",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"dump_bitmap_file",
"(",
"dump_file",
",",
"lp_reachable",
")",
";",
"}",
"if",
"(",
"dump_file",
")",
"{",
"FOR_EACH_VEC_SAFE_ELT",
"(",
"cfun",
"->",
"eh",
"->",
"region_array",
",",
"i",
",",
"region",
")",
"",
"if",
"(",
"region",
"&&",
"!",
"bitmap_bit_p",
"(",
"r_reachable",
",",
"region",
"->",
"index",
")",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"region",
"->",
"index",
")",
";",
"}",
"remove_unreachable_eh_regions",
"(",
"r_reachable",
")",
";",
"FOR_EACH_VEC_SAFE_ELT",
"(",
"cfun",
"->",
"eh",
"->",
"lp_array",
",",
"i",
",",
"lp",
")",
"",
"if",
"(",
"lp",
"&&",
"!",
"bitmap_bit_p",
"(",
"lp_reachable",
",",
"lp",
"->",
"index",
")",
")",
"{",
"if",
"(",
"dump_file",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"lp",
"->",
"index",
")",
";",
"remove_eh_landing_pad",
"(",
"lp",
")",
";",
"}",
"if",
"(",
"dump_file",
")",
"{",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\\n",
"\\n",
"\"",
")",
";",
"dump_eh_tree",
"(",
"dump_file",
",",
"cfun",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\\n",
"\"",
")",
";",
"}",
"sbitmap_free",
"(",
"r_reachable",
")",
";",
"sbitmap_free",
"(",
"lp_reachable",
")",
";",
"if",
"(",
"flag_checking",
")",
"verify_eh_tree",
"(",
"cfun",
")",
";",
"}"
] | Remove unreachable handlers and unreachable landing pads. | [
"Remove",
"unreachable",
"handlers",
"and",
"unreachable",
"landing",
"pads",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | maybe_remove_unreachable_handlers | void | void
maybe_remove_unreachable_handlers (void)
{
eh_landing_pad lp;
unsigned i;
if (cfun->eh == NULL)
return;
FOR_EACH_VEC_SAFE_ELT (cfun->eh->lp_array, i, lp)
if (lp && lp->post_landing_pad)
{
if (label_to_block (lp->post_landing_pad) == NULL)
{
remove_unreachable_handlers ();
return;
}
}
} | /* Remove unreachable handlers if any landing pads have been removed after
last ehcleanup pass (due to gimple_purge_dead_eh_edges). */ | Remove unreachable handlers if any landing pads have been removed after
last ehcleanup pass (due to gimple_purge_dead_eh_edges). | [
"Remove",
"unreachable",
"handlers",
"if",
"any",
"landing",
"pads",
"have",
"been",
"removed",
"after",
"last",
"ehcleanup",
"pass",
"(",
"due",
"to",
"gimple_purge_dead_eh_edges",
")",
"."
] | void
maybe_remove_unreachable_handlers (void)
{
eh_landing_pad lp;
unsigned i;
if (cfun->eh == NULL)
return;
FOR_EACH_VEC_SAFE_ELT (cfun->eh->lp_array, i, lp)
if (lp && lp->post_landing_pad)
{
if (label_to_block (lp->post_landing_pad) == NULL)
{
remove_unreachable_handlers ();
return;
}
}
} | [
"void",
"maybe_remove_unreachable_handlers",
"(",
"void",
")",
"{",
"eh_landing_pad",
"lp",
";",
"unsigned",
"i",
";",
"if",
"(",
"cfun",
"->",
"eh",
"==",
"NULL",
")",
"return",
";",
"FOR_EACH_VEC_SAFE_ELT",
"(",
"cfun",
"->",
"eh",
"->",
"lp_array",
",",
"i",
",",
"lp",
")",
"",
"if",
"(",
"lp",
"&&",
"lp",
"->",
"post_landing_pad",
")",
"{",
"if",
"(",
"label_to_block",
"(",
"lp",
"->",
"post_landing_pad",
")",
"==",
"NULL",
")",
"{",
"remove_unreachable_handlers",
"(",
")",
";",
"return",
";",
"}",
"}",
"}"
] | Remove unreachable handlers if any landing pads have been removed after
last ehcleanup pass (due to gimple_purge_dead_eh_edges). | [
"Remove",
"unreachable",
"handlers",
"if",
"any",
"landing",
"pads",
"have",
"been",
"removed",
"after",
"last",
"ehcleanup",
"pass",
"(",
"due",
"to",
"gimple_purge_dead_eh_edges",
")",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | remove_unreachable_handlers_no_lp | void | static void
remove_unreachable_handlers_no_lp (void)
{
eh_region region;
sbitmap r_reachable;
unsigned i;
mark_reachable_handlers (&r_reachable, /*lp_reachablep=*/NULL);
FOR_EACH_VEC_SAFE_ELT (cfun->eh->region_array, i, region)
{
if (! region)
continue;
if (region->landing_pads != NULL
|| region->type == ERT_MUST_NOT_THROW)
bitmap_set_bit (r_reachable, region->index);
if (dump_file
&& !bitmap_bit_p (r_reachable, region->index))
fprintf (dump_file,
"Removing unreachable region %d\n",
region->index);
}
remove_unreachable_eh_regions (r_reachable);
sbitmap_free (r_reachable);
} | /* Remove regions that do not have landing pads. This assumes
that remove_unreachable_handlers has already been run, and
that we've just manipulated the landing pads since then.
Preserve regions with landing pads and regions that prevent
exceptions from propagating further, even if these regions
are not reachable. */ | Remove regions that do not have landing pads. This assumes
that remove_unreachable_handlers has already been run, and
that we've just manipulated the landing pads since then.
Preserve regions with landing pads and regions that prevent
exceptions from propagating further, even if these regions
are not reachable. | [
"Remove",
"regions",
"that",
"do",
"not",
"have",
"landing",
"pads",
".",
"This",
"assumes",
"that",
"remove_unreachable_handlers",
"has",
"already",
"been",
"run",
"and",
"that",
"we",
"'",
"ve",
"just",
"manipulated",
"the",
"landing",
"pads",
"since",
"then",
".",
"Preserve",
"regions",
"with",
"landing",
"pads",
"and",
"regions",
"that",
"prevent",
"exceptions",
"from",
"propagating",
"further",
"even",
"if",
"these",
"regions",
"are",
"not",
"reachable",
"."
] | static void
remove_unreachable_handlers_no_lp (void)
{
eh_region region;
sbitmap r_reachable;
unsigned i;
mark_reachable_handlers (&r_reachable, NULL);
FOR_EACH_VEC_SAFE_ELT (cfun->eh->region_array, i, region)
{
if (! region)
continue;
if (region->landing_pads != NULL
|| region->type == ERT_MUST_NOT_THROW)
bitmap_set_bit (r_reachable, region->index);
if (dump_file
&& !bitmap_bit_p (r_reachable, region->index))
fprintf (dump_file,
"Removing unreachable region %d\n",
region->index);
}
remove_unreachable_eh_regions (r_reachable);
sbitmap_free (r_reachable);
} | [
"static",
"void",
"remove_unreachable_handlers_no_lp",
"(",
"void",
")",
"{",
"eh_region",
"region",
";",
"sbitmap",
"r_reachable",
";",
"unsigned",
"i",
";",
"mark_reachable_handlers",
"(",
"&",
"r_reachable",
",",
"NULL",
")",
";",
"FOR_EACH_VEC_SAFE_ELT",
"(",
"cfun",
"->",
"eh",
"->",
"region_array",
",",
"i",
",",
"region",
")",
"",
"{",
"if",
"(",
"!",
"region",
")",
"continue",
";",
"if",
"(",
"region",
"->",
"landing_pads",
"!=",
"NULL",
"||",
"region",
"->",
"type",
"==",
"ERT_MUST_NOT_THROW",
")",
"bitmap_set_bit",
"(",
"r_reachable",
",",
"region",
"->",
"index",
")",
";",
"if",
"(",
"dump_file",
"&&",
"!",
"bitmap_bit_p",
"(",
"r_reachable",
",",
"region",
"->",
"index",
")",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"region",
"->",
"index",
")",
";",
"}",
"remove_unreachable_eh_regions",
"(",
"r_reachable",
")",
";",
"sbitmap_free",
"(",
"r_reachable",
")",
";",
"}"
] | Remove regions that do not have landing pads. | [
"Remove",
"regions",
"that",
"do",
"not",
"have",
"landing",
"pads",
"."
] | [
"/*lp_reachablep=*/"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | unsplit_all_eh | bool | static bool
unsplit_all_eh (void)
{
bool changed = false;
eh_landing_pad lp;
int i;
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
if (lp)
changed |= unsplit_eh (lp);
return changed;
} | /* Examine each landing pad block and see if it matches unsplit_eh. */ | Examine each landing pad block and see if it matches unsplit_eh. | [
"Examine",
"each",
"landing",
"pad",
"block",
"and",
"see",
"if",
"it",
"matches",
"unsplit_eh",
"."
] | static bool
unsplit_all_eh (void)
{
bool changed = false;
eh_landing_pad lp;
int i;
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
if (lp)
changed |= unsplit_eh (lp);
return changed;
} | [
"static",
"bool",
"unsplit_all_eh",
"(",
"void",
")",
"{",
"bool",
"changed",
"=",
"false",
";",
"eh_landing_pad",
"lp",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"1",
";",
"vec_safe_iterate",
"(",
"cfun",
"->",
"eh",
"->",
"lp_array",
",",
"i",
",",
"&",
"lp",
")",
";",
"++",
"i",
")",
"if",
"(",
"lp",
")",
"changed",
"|=",
"unsplit_eh",
"(",
"lp",
")",
";",
"return",
"changed",
";",
"}"
] | Examine each landing pad block and see if it matches unsplit_eh. | [
"Examine",
"each",
"landing",
"pad",
"block",
"and",
"see",
"if",
"it",
"matches",
"unsplit_eh",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | cleanup_empty_eh_merge_phis | bool | static bool
cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
edge old_bb_out, bool change_region)
{
gphi_iterator ngsi, ogsi;
edge_iterator ei;
edge e;
bitmap ophi_handled;
/* The destination block must not be a regular successor for any
of the preds of the landing pad. Thus, avoid turning
<..>
| \ EH
| <..>
| /
<..>
into
<..>
| | EH
<..>
which CFG verification would choke on. See PR45172 and PR51089. */
FOR_EACH_EDGE (e, ei, old_bb->preds)
if (find_edge (e->src, new_bb))
return false;
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_clear (e);
ophi_handled = BITMAP_ALLOC (NULL);
/* First, iterate through the PHIs on NEW_BB and set up the edge_var_map
for the edges we're going to move. */
for (ngsi = gsi_start_phis (new_bb); !gsi_end_p (ngsi); gsi_next (&ngsi))
{
gphi *ophi, *nphi = ngsi.phi ();
tree nresult, nop;
nresult = gimple_phi_result (nphi);
nop = gimple_phi_arg_def (nphi, old_bb_out->dest_idx);
/* Find the corresponding PHI in OLD_BB so we can forward-propagate
the source ssa_name. */
ophi = NULL;
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
{
ophi = ogsi.phi ();
if (gimple_phi_result (ophi) == nop)
break;
ophi = NULL;
}
/* If we did find the corresponding PHI, copy those inputs. */
if (ophi)
{
/* If NOP is used somewhere else beyond phis in new_bb, give up. */
if (!has_single_use (nop))
{
imm_use_iterator imm_iter;
use_operand_p use_p;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, nop)
{
if (!gimple_debug_bind_p (USE_STMT (use_p))
&& (gimple_code (USE_STMT (use_p)) != GIMPLE_PHI
|| gimple_bb (USE_STMT (use_p)) != new_bb))
goto fail;
}
}
bitmap_set_bit (ophi_handled, SSA_NAME_VERSION (nop));
FOR_EACH_EDGE (e, ei, old_bb->preds)
{
location_t oloc;
tree oop;
if ((e->flags & EDGE_EH) == 0)
continue;
oop = gimple_phi_arg_def (ophi, e->dest_idx);
oloc = gimple_phi_arg_location (ophi, e->dest_idx);
redirect_edge_var_map_add (e, nresult, oop, oloc);
}
}
/* If we didn't find the PHI, if it's a real variable or a VOP, we know
from the fact that OLD_BB is tree_empty_eh_handler_p that the
variable is unchanged from input to the block and we can simply
re-use the input to NEW_BB from the OLD_BB_OUT edge. */
else
{
location_t nloc
= gimple_phi_arg_location (nphi, old_bb_out->dest_idx);
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_add (e, nresult, nop, nloc);
}
}
/* Second, verify that all PHIs from OLD_BB have been handled. If not,
we don't know what values from the other edges into NEW_BB to use. */
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
{
gphi *ophi = ogsi.phi ();
tree oresult = gimple_phi_result (ophi);
if (!bitmap_bit_p (ophi_handled, SSA_NAME_VERSION (oresult)))
goto fail;
}
/* Finally, move the edges and update the PHIs. */
for (ei = ei_start (old_bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
/* ??? CFG manipluation routines do not try to update loop
form on edge redirection. Do so manually here for now. */
/* If we redirect a loop entry or latch edge that will either create
a multiple entry loop or rotate the loop. If the loops merge
we may have created a loop with multiple latches.
All of this isn't easily fixed thus cancel the affected loop
and mark the other loop as possibly having multiple latches. */
if (e->dest == e->dest->loop_father->header)
{
mark_loop_for_removal (e->dest->loop_father);
new_bb->loop_father->latch = NULL;
loops_state_set (LOOPS_MAY_HAVE_MULTIPLE_LATCHES);
}
redirect_eh_edge_1 (e, new_bb, change_region);
redirect_edge_succ (e, new_bb);
flush_pending_stmts (e);
}
else
ei_next (&ei);
BITMAP_FREE (ophi_handled);
return true;
fail:
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_clear (e);
BITMAP_FREE (ophi_handled);
return false;
} | /* A subroutine of cleanup_empty_eh. Redirect all EH edges incoming
to OLD_BB to NEW_BB; return true on success, false on failure.
OLD_BB_OUT is the edge into NEW_BB from OLD_BB, so if we miss any
PHI variables from OLD_BB we can pick them up from OLD_BB_OUT.
Virtual PHIs may be deleted and marked for renaming. */ | A subroutine of cleanup_empty_eh. Redirect all EH edges incoming
to OLD_BB to NEW_BB; return true on success, false on failure.
OLD_BB_OUT is the edge into NEW_BB from OLD_BB, so if we miss any
PHI variables from OLD_BB we can pick them up from OLD_BB_OUT.
Virtual PHIs may be deleted and marked for renaming. | [
"A",
"subroutine",
"of",
"cleanup_empty_eh",
".",
"Redirect",
"all",
"EH",
"edges",
"incoming",
"to",
"OLD_BB",
"to",
"NEW_BB",
";",
"return",
"true",
"on",
"success",
"false",
"on",
"failure",
".",
"OLD_BB_OUT",
"is",
"the",
"edge",
"into",
"NEW_BB",
"from",
"OLD_BB",
"so",
"if",
"we",
"miss",
"any",
"PHI",
"variables",
"from",
"OLD_BB",
"we",
"can",
"pick",
"them",
"up",
"from",
"OLD_BB_OUT",
".",
"Virtual",
"PHIs",
"may",
"be",
"deleted",
"and",
"marked",
"for",
"renaming",
"."
] | static bool
cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
edge old_bb_out, bool change_region)
{
gphi_iterator ngsi, ogsi;
edge_iterator ei;
edge e;
bitmap ophi_handled;
FOR_EACH_EDGE (e, ei, old_bb->preds)
if (find_edge (e->src, new_bb))
return false;
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_clear (e);
ophi_handled = BITMAP_ALLOC (NULL);
for (ngsi = gsi_start_phis (new_bb); !gsi_end_p (ngsi); gsi_next (&ngsi))
{
gphi *ophi, *nphi = ngsi.phi ();
tree nresult, nop;
nresult = gimple_phi_result (nphi);
nop = gimple_phi_arg_def (nphi, old_bb_out->dest_idx);
ophi = NULL;
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
{
ophi = ogsi.phi ();
if (gimple_phi_result (ophi) == nop)
break;
ophi = NULL;
}
if (ophi)
{
if (!has_single_use (nop))
{
imm_use_iterator imm_iter;
use_operand_p use_p;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, nop)
{
if (!gimple_debug_bind_p (USE_STMT (use_p))
&& (gimple_code (USE_STMT (use_p)) != GIMPLE_PHI
|| gimple_bb (USE_STMT (use_p)) != new_bb))
goto fail;
}
}
bitmap_set_bit (ophi_handled, SSA_NAME_VERSION (nop));
FOR_EACH_EDGE (e, ei, old_bb->preds)
{
location_t oloc;
tree oop;
if ((e->flags & EDGE_EH) == 0)
continue;
oop = gimple_phi_arg_def (ophi, e->dest_idx);
oloc = gimple_phi_arg_location (ophi, e->dest_idx);
redirect_edge_var_map_add (e, nresult, oop, oloc);
}
}
else
{
location_t nloc
= gimple_phi_arg_location (nphi, old_bb_out->dest_idx);
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_add (e, nresult, nop, nloc);
}
}
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
{
gphi *ophi = ogsi.phi ();
tree oresult = gimple_phi_result (ophi);
if (!bitmap_bit_p (ophi_handled, SSA_NAME_VERSION (oresult)))
goto fail;
}
for (ei = ei_start (old_bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
if (e->dest == e->dest->loop_father->header)
{
mark_loop_for_removal (e->dest->loop_father);
new_bb->loop_father->latch = NULL;
loops_state_set (LOOPS_MAY_HAVE_MULTIPLE_LATCHES);
}
redirect_eh_edge_1 (e, new_bb, change_region);
redirect_edge_succ (e, new_bb);
flush_pending_stmts (e);
}
else
ei_next (&ei);
BITMAP_FREE (ophi_handled);
return true;
fail:
FOR_EACH_EDGE (e, ei, old_bb->preds)
redirect_edge_var_map_clear (e);
BITMAP_FREE (ophi_handled);
return false;
} | [
"static",
"bool",
"cleanup_empty_eh_merge_phis",
"(",
"basic_block",
"new_bb",
",",
"basic_block",
"old_bb",
",",
"edge",
"old_bb_out",
",",
"bool",
"change_region",
")",
"{",
"gphi_iterator",
"ngsi",
",",
"ogsi",
";",
"edge_iterator",
"ei",
";",
"edge",
"e",
";",
"bitmap",
"ophi_handled",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"if",
"(",
"find_edge",
"(",
"e",
"->",
"src",
",",
"new_bb",
")",
")",
"return",
"false",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"redirect_edge_var_map_clear",
"(",
"e",
")",
";",
"ophi_handled",
"=",
"BITMAP_ALLOC",
"(",
"NULL",
")",
";",
"for",
"(",
"ngsi",
"=",
"gsi_start_phis",
"(",
"new_bb",
")",
";",
"!",
"gsi_end_p",
"(",
"ngsi",
")",
";",
"gsi_next",
"(",
"&",
"ngsi",
")",
")",
"{",
"gphi",
"*",
"ophi",
",",
"*",
"nphi",
"=",
"ngsi",
".",
"phi",
"(",
")",
";",
"tree",
"nresult",
",",
"nop",
";",
"nresult",
"=",
"gimple_phi_result",
"(",
"nphi",
")",
";",
"nop",
"=",
"gimple_phi_arg_def",
"(",
"nphi",
",",
"old_bb_out",
"->",
"dest_idx",
")",
";",
"ophi",
"=",
"NULL",
";",
"for",
"(",
"ogsi",
"=",
"gsi_start_phis",
"(",
"old_bb",
")",
";",
"!",
"gsi_end_p",
"(",
"ogsi",
")",
";",
"gsi_next",
"(",
"&",
"ogsi",
")",
")",
"{",
"ophi",
"=",
"ogsi",
".",
"phi",
"(",
")",
";",
"if",
"(",
"gimple_phi_result",
"(",
"ophi",
")",
"==",
"nop",
")",
"break",
";",
"ophi",
"=",
"NULL",
";",
"}",
"if",
"(",
"ophi",
")",
"{",
"if",
"(",
"!",
"has_single_use",
"(",
"nop",
")",
")",
"{",
"imm_use_iterator",
"imm_iter",
";",
"use_operand_p",
"use_p",
";",
"FOR_EACH_IMM_USE_FAST",
"(",
"use_p",
",",
"imm_iter",
",",
"nop",
")",
"",
"{",
"if",
"(",
"!",
"gimple_debug_bind_p",
"(",
"USE_STMT",
"(",
"use_p",
")",
")",
"&&",
"(",
"gimple_code",
"(",
"USE_STMT",
"(",
"use_p",
")",
")",
"!=",
"GIMPLE_PHI",
"||",
"gimple_bb",
"(",
"USE_STMT",
"(",
"use_p",
")",
")",
"!=",
"new_bb",
")",
")",
"goto",
"fail",
";",
"}",
"}",
"bitmap_set_bit",
"(",
"ophi_handled",
",",
"SSA_NAME_VERSION",
"(",
"nop",
")",
")",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"{",
"location_t",
"oloc",
";",
"tree",
"oop",
";",
"if",
"(",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
"==",
"0",
")",
"continue",
";",
"oop",
"=",
"gimple_phi_arg_def",
"(",
"ophi",
",",
"e",
"->",
"dest_idx",
")",
";",
"oloc",
"=",
"gimple_phi_arg_location",
"(",
"ophi",
",",
"e",
"->",
"dest_idx",
")",
";",
"redirect_edge_var_map_add",
"(",
"e",
",",
"nresult",
",",
"oop",
",",
"oloc",
")",
";",
"}",
"}",
"else",
"{",
"location_t",
"nloc",
"=",
"gimple_phi_arg_location",
"(",
"nphi",
",",
"old_bb_out",
"->",
"dest_idx",
")",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"redirect_edge_var_map_add",
"(",
"e",
",",
"nresult",
",",
"nop",
",",
"nloc",
")",
";",
"}",
"}",
"for",
"(",
"ogsi",
"=",
"gsi_start_phis",
"(",
"old_bb",
")",
";",
"!",
"gsi_end_p",
"(",
"ogsi",
")",
";",
"gsi_next",
"(",
"&",
"ogsi",
")",
")",
"{",
"gphi",
"*",
"ophi",
"=",
"ogsi",
".",
"phi",
"(",
")",
";",
"tree",
"oresult",
"=",
"gimple_phi_result",
"(",
"ophi",
")",
";",
"if",
"(",
"!",
"bitmap_bit_p",
"(",
"ophi_handled",
",",
"SSA_NAME_VERSION",
"(",
"oresult",
")",
")",
")",
"goto",
"fail",
";",
"}",
"for",
"(",
"ei",
"=",
"ei_start",
"(",
"old_bb",
"->",
"preds",
")",
";",
"(",
"e",
"=",
"ei_safe_edge",
"(",
"ei",
")",
")",
";",
")",
"if",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
"{",
"if",
"(",
"e",
"->",
"dest",
"==",
"e",
"->",
"dest",
"->",
"loop_father",
"->",
"header",
")",
"{",
"mark_loop_for_removal",
"(",
"e",
"->",
"dest",
"->",
"loop_father",
")",
";",
"new_bb",
"->",
"loop_father",
"->",
"latch",
"=",
"NULL",
";",
"loops_state_set",
"(",
"LOOPS_MAY_HAVE_MULTIPLE_LATCHES",
")",
";",
"}",
"redirect_eh_edge_1",
"(",
"e",
",",
"new_bb",
",",
"change_region",
")",
";",
"redirect_edge_succ",
"(",
"e",
",",
"new_bb",
")",
";",
"flush_pending_stmts",
"(",
"e",
")",
";",
"}",
"else",
"ei_next",
"(",
"&",
"ei",
")",
";",
"BITMAP_FREE",
"(",
"ophi_handled",
")",
";",
"return",
"true",
";",
"fail",
":",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"old_bb",
"->",
"preds",
")",
"",
"redirect_edge_var_map_clear",
"(",
"e",
")",
";",
"BITMAP_FREE",
"(",
"ophi_handled",
")",
";",
"return",
"false",
";",
"}"
] | A subroutine of cleanup_empty_eh. | [
"A",
"subroutine",
"of",
"cleanup_empty_eh",
"."
] | [
"/* The destination block must not be a regular successor for any\n of the preds of the landing pad. Thus, avoid turning\n <..>\n\t | \\ EH\n\t | <..>\n\t | /\n\t<..>\n into\n <..>\n\t| | EH\n\t<..>\n which CFG verification would choke on. See PR45172 and PR51089. */",
"/* First, iterate through the PHIs on NEW_BB and set up the edge_var_map\n for the edges we're going to move. */",
"/* Find the corresponding PHI in OLD_BB so we can forward-propagate\n\t the source ssa_name. */",
"/* If we did find the corresponding PHI, copy those inputs. */",
"/* If NOP is used somewhere else beyond phis in new_bb, give up. */",
"/* If we didn't find the PHI, if it's a real variable or a VOP, we know\n\t from the fact that OLD_BB is tree_empty_eh_handler_p that the\n\t variable is unchanged from input to the block and we can simply\n\t re-use the input to NEW_BB from the OLD_BB_OUT edge. */",
"/* Second, verify that all PHIs from OLD_BB have been handled. If not,\n we don't know what values from the other edges into NEW_BB to use. */",
"/* Finally, move the edges and update the PHIs. */",
"/* ??? CFG manipluation routines do not try to update loop\n\t form on edge redirection. Do so manually here for now. */",
"/* If we redirect a loop entry or latch edge that will either create\n\t a multiple entry loop or rotate the loop. If the loops merge\n\t we may have created a loop with multiple latches.\n\t All of this isn't easily fixed thus cancel the affected loop\n\t and mark the other loop as possibly having multiple latches. */"
] | [
{
"param": "new_bb",
"type": "basic_block"
},
{
"param": "old_bb",
"type": "basic_block"
},
{
"param": "old_bb_out",
"type": "edge"
},
{
"param": "change_region",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "new_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "old_bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "old_bb_out",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "change_region",
"type": "bool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | infinite_empty_loop_p | bool | static bool
infinite_empty_loop_p (edge e_first)
{
bool inf_loop = false;
edge e;
if (e_first->dest == e_first->src)
return true;
e_first->src->aux = (void *) 1;
for (e = e_first; single_succ_p (e->dest); e = single_succ_edge (e->dest))
{
gimple_stmt_iterator gsi;
if (e->dest->aux)
{
inf_loop = true;
break;
}
e->dest->aux = (void *) 1;
gsi = gsi_after_labels (e->dest);
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
gsi_next_nondebug (&gsi);
if (!gsi_end_p (gsi))
break;
}
e_first->src->aux = NULL;
for (e = e_first; e->dest->aux; e = single_succ_edge (e->dest))
e->dest->aux = NULL;
return inf_loop;
} | /* Return true if edge E_FIRST is part of an empty infinite loop
or leads to such a loop through a series of single successor
empty bbs. */ | Return true if edge E_FIRST is part of an empty infinite loop
or leads to such a loop through a series of single successor
empty bbs. | [
"Return",
"true",
"if",
"edge",
"E_FIRST",
"is",
"part",
"of",
"an",
"empty",
"infinite",
"loop",
"or",
"leads",
"to",
"such",
"a",
"loop",
"through",
"a",
"series",
"of",
"single",
"successor",
"empty",
"bbs",
"."
] | static bool
infinite_empty_loop_p (edge e_first)
{
bool inf_loop = false;
edge e;
if (e_first->dest == e_first->src)
return true;
e_first->src->aux = (void *) 1;
for (e = e_first; single_succ_p (e->dest); e = single_succ_edge (e->dest))
{
gimple_stmt_iterator gsi;
if (e->dest->aux)
{
inf_loop = true;
break;
}
e->dest->aux = (void *) 1;
gsi = gsi_after_labels (e->dest);
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
gsi_next_nondebug (&gsi);
if (!gsi_end_p (gsi))
break;
}
e_first->src->aux = NULL;
for (e = e_first; e->dest->aux; e = single_succ_edge (e->dest))
e->dest->aux = NULL;
return inf_loop;
} | [
"static",
"bool",
"infinite_empty_loop_p",
"(",
"edge",
"e_first",
")",
"{",
"bool",
"inf_loop",
"=",
"false",
";",
"edge",
"e",
";",
"if",
"(",
"e_first",
"->",
"dest",
"==",
"e_first",
"->",
"src",
")",
"return",
"true",
";",
"e_first",
"->",
"src",
"->",
"aux",
"=",
"(",
"void",
"*",
")",
"1",
";",
"for",
"(",
"e",
"=",
"e_first",
";",
"single_succ_p",
"(",
"e",
"->",
"dest",
")",
";",
"e",
"=",
"single_succ_edge",
"(",
"e",
"->",
"dest",
")",
")",
"{",
"gimple_stmt_iterator",
"gsi",
";",
"if",
"(",
"e",
"->",
"dest",
"->",
"aux",
")",
"{",
"inf_loop",
"=",
"true",
";",
"break",
";",
"}",
"e",
"->",
"dest",
"->",
"aux",
"=",
"(",
"void",
"*",
")",
"1",
";",
"gsi",
"=",
"gsi_after_labels",
"(",
"e",
"->",
"dest",
")",
";",
"if",
"(",
"!",
"gsi_end_p",
"(",
"gsi",
")",
"&&",
"is_gimple_debug",
"(",
"gsi_stmt",
"(",
"gsi",
")",
")",
")",
"gsi_next_nondebug",
"(",
"&",
"gsi",
")",
";",
"if",
"(",
"!",
"gsi_end_p",
"(",
"gsi",
")",
")",
"break",
";",
"}",
"e_first",
"->",
"src",
"->",
"aux",
"=",
"NULL",
";",
"for",
"(",
"e",
"=",
"e_first",
";",
"e",
"->",
"dest",
"->",
"aux",
";",
"e",
"=",
"single_succ_edge",
"(",
"e",
"->",
"dest",
")",
")",
"e",
"->",
"dest",
"->",
"aux",
"=",
"NULL",
";",
"return",
"inf_loop",
";",
"}"
] | Return true if edge E_FIRST is part of an empty infinite loop
or leads to such a loop through a series of single successor
empty bbs. | [
"Return",
"true",
"if",
"edge",
"E_FIRST",
"is",
"part",
"of",
"an",
"empty",
"infinite",
"loop",
"or",
"leads",
"to",
"such",
"a",
"loop",
"through",
"a",
"series",
"of",
"single",
"successor",
"empty",
"bbs",
"."
] | [] | [
{
"param": "e_first",
"type": "edge"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "e_first",
"type": "edge",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | cleanup_empty_eh | bool | static bool
cleanup_empty_eh (eh_landing_pad lp)
{
basic_block bb = label_to_block (lp->post_landing_pad);
gimple_stmt_iterator gsi;
gimple *resx;
eh_region new_region;
edge_iterator ei;
edge e, e_out;
bool has_non_eh_pred;
bool ret = false;
int new_lp_nr;
/* There can be zero or one edges out of BB. This is the quickest test. */
switch (EDGE_COUNT (bb->succs))
{
case 0:
e_out = NULL;
break;
case 1:
e_out = single_succ_edge (bb);
break;
default:
return false;
}
gsi = gsi_last_nondebug_bb (bb);
resx = gsi_stmt (gsi);
if (resx && is_gimple_resx (resx))
{
if (stmt_can_throw_external (resx))
optimize_clobbers (bb);
else if (sink_clobbers (bb))
ret = true;
}
gsi = gsi_after_labels (bb);
/* Make sure to skip debug statements. */
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
gsi_next_nondebug (&gsi);
/* If the block is totally empty, look for more unsplitting cases. */
if (gsi_end_p (gsi))
{
/* For the degenerate case of an infinite loop bail out.
If bb has no successors and is totally empty, which can happen e.g.
because of incorrect noreturn attribute, bail out too. */
if (e_out == NULL
|| infinite_empty_loop_p (e_out))
return ret;
return ret | cleanup_empty_eh_unsplit (bb, e_out, lp);
}
/* The block should consist only of a single RESX statement, modulo a
preceding call to __builtin_stack_restore if there is no outgoing
edge, since the call can be eliminated in this case. */
resx = gsi_stmt (gsi);
if (!e_out && gimple_call_builtin_p (resx, BUILT_IN_STACK_RESTORE))
{
gsi_next_nondebug (&gsi);
resx = gsi_stmt (gsi);
}
if (!is_gimple_resx (resx))
return ret;
gcc_assert (gsi_one_nondebug_before_end_p (gsi));
/* Determine if there are non-EH edges, or resx edges into the handler. */
has_non_eh_pred = false;
FOR_EACH_EDGE (e, ei, bb->preds)
if (!(e->flags & EDGE_EH))
has_non_eh_pred = true;
/* Find the handler that's outer of the empty handler by looking at
where the RESX instruction was vectored. */
new_lp_nr = lookup_stmt_eh_lp (resx);
new_region = get_eh_region_from_lp_number (new_lp_nr);
/* If there's no destination region within the current function,
redirection is trivial via removing the throwing statements from
the EH region, removing the EH edges, and allowing the block
to go unreachable. */
if (new_region == NULL)
{
gcc_assert (e_out == NULL);
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
gimple *stmt = last_stmt (e->src);
remove_stmt_from_eh_lp (stmt);
remove_edge (e);
}
else
ei_next (&ei);
goto succeed;
}
/* If the destination region is a MUST_NOT_THROW, allow the runtime
to handle the abort and allow the blocks to go unreachable. */
if (new_region->type == ERT_MUST_NOT_THROW)
{
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
gimple *stmt = last_stmt (e->src);
remove_stmt_from_eh_lp (stmt);
add_stmt_to_eh_lp (stmt, new_lp_nr);
remove_edge (e);
}
else
ei_next (&ei);
goto succeed;
}
/* Try to redirect the EH edges and merge the PHIs into the destination
landing pad block. If the merge succeeds, we'll already have redirected
all the EH edges. The handler itself will go unreachable if there were
no normal edges. */
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, true))
goto succeed;
/* Finally, if all input edges are EH edges, then we can (potentially)
reduce the number of transfers from the runtime by moving the landing
pad from the original region to the new region. This is a win when
we remove the last CLEANUP region along a particular exception
propagation path. Since nothing changes except for the region with
which the landing pad is associated, the PHI nodes do not need to be
adjusted at all. */
if (!has_non_eh_pred)
{
cleanup_empty_eh_move_lp (bb, e_out, lp, new_region);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Empty EH handler %i moved to EH region %i.\n",
lp->index, new_region->index);
/* ??? The CFG didn't change, but we may have rendered the
old EH region unreachable. Trigger a cleanup there. */
return true;
}
return ret;
succeed:
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Empty EH handler %i removed.\n", lp->index);
remove_eh_landing_pad (lp);
return true;
} | /* Examine the block associated with LP to determine if it's an empty
handler for its EH region. If so, attempt to redirect EH edges to
an outer region. Return true the CFG was updated in any way. This
is similar to jump forwarding, just across EH edges. */ | Examine the block associated with LP to determine if it's an empty
handler for its EH region. If so, attempt to redirect EH edges to
an outer region. Return true the CFG was updated in any way. This
is similar to jump forwarding, just across EH edges. | [
"Examine",
"the",
"block",
"associated",
"with",
"LP",
"to",
"determine",
"if",
"it",
"'",
"s",
"an",
"empty",
"handler",
"for",
"its",
"EH",
"region",
".",
"If",
"so",
"attempt",
"to",
"redirect",
"EH",
"edges",
"to",
"an",
"outer",
"region",
".",
"Return",
"true",
"the",
"CFG",
"was",
"updated",
"in",
"any",
"way",
".",
"This",
"is",
"similar",
"to",
"jump",
"forwarding",
"just",
"across",
"EH",
"edges",
"."
] | static bool
cleanup_empty_eh (eh_landing_pad lp)
{
basic_block bb = label_to_block (lp->post_landing_pad);
gimple_stmt_iterator gsi;
gimple *resx;
eh_region new_region;
edge_iterator ei;
edge e, e_out;
bool has_non_eh_pred;
bool ret = false;
int new_lp_nr;
switch (EDGE_COUNT (bb->succs))
{
case 0:
e_out = NULL;
break;
case 1:
e_out = single_succ_edge (bb);
break;
default:
return false;
}
gsi = gsi_last_nondebug_bb (bb);
resx = gsi_stmt (gsi);
if (resx && is_gimple_resx (resx))
{
if (stmt_can_throw_external (resx))
optimize_clobbers (bb);
else if (sink_clobbers (bb))
ret = true;
}
gsi = gsi_after_labels (bb);
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
gsi_next_nondebug (&gsi);
if (gsi_end_p (gsi))
{
if (e_out == NULL
|| infinite_empty_loop_p (e_out))
return ret;
return ret | cleanup_empty_eh_unsplit (bb, e_out, lp);
}
resx = gsi_stmt (gsi);
if (!e_out && gimple_call_builtin_p (resx, BUILT_IN_STACK_RESTORE))
{
gsi_next_nondebug (&gsi);
resx = gsi_stmt (gsi);
}
if (!is_gimple_resx (resx))
return ret;
gcc_assert (gsi_one_nondebug_before_end_p (gsi));
has_non_eh_pred = false;
FOR_EACH_EDGE (e, ei, bb->preds)
if (!(e->flags & EDGE_EH))
has_non_eh_pred = true;
new_lp_nr = lookup_stmt_eh_lp (resx);
new_region = get_eh_region_from_lp_number (new_lp_nr);
if (new_region == NULL)
{
gcc_assert (e_out == NULL);
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
gimple *stmt = last_stmt (e->src);
remove_stmt_from_eh_lp (stmt);
remove_edge (e);
}
else
ei_next (&ei);
goto succeed;
}
if (new_region->type == ERT_MUST_NOT_THROW)
{
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
gimple *stmt = last_stmt (e->src);
remove_stmt_from_eh_lp (stmt);
add_stmt_to_eh_lp (stmt, new_lp_nr);
remove_edge (e);
}
else
ei_next (&ei);
goto succeed;
}
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, true))
goto succeed;
if (!has_non_eh_pred)
{
cleanup_empty_eh_move_lp (bb, e_out, lp, new_region);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Empty EH handler %i moved to EH region %i.\n",
lp->index, new_region->index);
return true;
}
return ret;
succeed:
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Empty EH handler %i removed.\n", lp->index);
remove_eh_landing_pad (lp);
return true;
} | [
"static",
"bool",
"cleanup_empty_eh",
"(",
"eh_landing_pad",
"lp",
")",
"{",
"basic_block",
"bb",
"=",
"label_to_block",
"(",
"lp",
"->",
"post_landing_pad",
")",
";",
"gimple_stmt_iterator",
"gsi",
";",
"gimple",
"*",
"resx",
";",
"eh_region",
"new_region",
";",
"edge_iterator",
"ei",
";",
"edge",
"e",
",",
"e_out",
";",
"bool",
"has_non_eh_pred",
";",
"bool",
"ret",
"=",
"false",
";",
"int",
"new_lp_nr",
";",
"switch",
"(",
"EDGE_COUNT",
"(",
"bb",
"->",
"succs",
")",
")",
"{",
"case",
"0",
":",
"e_out",
"=",
"NULL",
";",
"break",
";",
"case",
"1",
":",
"e_out",
"=",
"single_succ_edge",
"(",
"bb",
")",
";",
"break",
";",
"default",
":",
"return",
"false",
";",
"}",
"gsi",
"=",
"gsi_last_nondebug_bb",
"(",
"bb",
")",
";",
"resx",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"resx",
"&&",
"is_gimple_resx",
"(",
"resx",
")",
")",
"{",
"if",
"(",
"stmt_can_throw_external",
"(",
"resx",
")",
")",
"optimize_clobbers",
"(",
"bb",
")",
";",
"else",
"if",
"(",
"sink_clobbers",
"(",
"bb",
")",
")",
"ret",
"=",
"true",
";",
"}",
"gsi",
"=",
"gsi_after_labels",
"(",
"bb",
")",
";",
"if",
"(",
"!",
"gsi_end_p",
"(",
"gsi",
")",
"&&",
"is_gimple_debug",
"(",
"gsi_stmt",
"(",
"gsi",
")",
")",
")",
"gsi_next_nondebug",
"(",
"&",
"gsi",
")",
";",
"if",
"(",
"gsi_end_p",
"(",
"gsi",
")",
")",
"{",
"if",
"(",
"e_out",
"==",
"NULL",
"||",
"infinite_empty_loop_p",
"(",
"e_out",
")",
")",
"return",
"ret",
";",
"return",
"ret",
"|",
"cleanup_empty_eh_unsplit",
"(",
"bb",
",",
"e_out",
",",
"lp",
")",
";",
"}",
"resx",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"if",
"(",
"!",
"e_out",
"&&",
"gimple_call_builtin_p",
"(",
"resx",
",",
"BUILT_IN_STACK_RESTORE",
")",
")",
"{",
"gsi_next_nondebug",
"(",
"&",
"gsi",
")",
";",
"resx",
"=",
"gsi_stmt",
"(",
"gsi",
")",
";",
"}",
"if",
"(",
"!",
"is_gimple_resx",
"(",
"resx",
")",
")",
"return",
"ret",
";",
"gcc_assert",
"(",
"gsi_one_nondebug_before_end_p",
"(",
"gsi",
")",
")",
";",
"has_non_eh_pred",
"=",
"false",
";",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"bb",
"->",
"preds",
")",
"",
"if",
"(",
"!",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
")",
"has_non_eh_pred",
"=",
"true",
";",
"new_lp_nr",
"=",
"lookup_stmt_eh_lp",
"(",
"resx",
")",
";",
"new_region",
"=",
"get_eh_region_from_lp_number",
"(",
"new_lp_nr",
")",
";",
"if",
"(",
"new_region",
"==",
"NULL",
")",
"{",
"gcc_assert",
"(",
"e_out",
"==",
"NULL",
")",
";",
"for",
"(",
"ei",
"=",
"ei_start",
"(",
"bb",
"->",
"preds",
")",
";",
"(",
"e",
"=",
"ei_safe_edge",
"(",
"ei",
")",
")",
";",
")",
"if",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
"{",
"gimple",
"*",
"stmt",
"=",
"last_stmt",
"(",
"e",
"->",
"src",
")",
";",
"remove_stmt_from_eh_lp",
"(",
"stmt",
")",
";",
"remove_edge",
"(",
"e",
")",
";",
"}",
"else",
"ei_next",
"(",
"&",
"ei",
")",
";",
"goto",
"succeed",
";",
"}",
"if",
"(",
"new_region",
"->",
"type",
"==",
"ERT_MUST_NOT_THROW",
")",
"{",
"for",
"(",
"ei",
"=",
"ei_start",
"(",
"bb",
"->",
"preds",
")",
";",
"(",
"e",
"=",
"ei_safe_edge",
"(",
"ei",
")",
")",
";",
")",
"if",
"(",
"e",
"->",
"flags",
"&",
"EDGE_EH",
")",
"{",
"gimple",
"*",
"stmt",
"=",
"last_stmt",
"(",
"e",
"->",
"src",
")",
";",
"remove_stmt_from_eh_lp",
"(",
"stmt",
")",
";",
"add_stmt_to_eh_lp",
"(",
"stmt",
",",
"new_lp_nr",
")",
";",
"remove_edge",
"(",
"e",
")",
";",
"}",
"else",
"ei_next",
"(",
"&",
"ei",
")",
";",
"goto",
"succeed",
";",
"}",
"if",
"(",
"cleanup_empty_eh_merge_phis",
"(",
"e_out",
"->",
"dest",
",",
"bb",
",",
"e_out",
",",
"true",
")",
")",
"goto",
"succeed",
";",
"if",
"(",
"!",
"has_non_eh_pred",
")",
"{",
"cleanup_empty_eh_move_lp",
"(",
"bb",
",",
"e_out",
",",
"lp",
",",
"new_region",
")",
";",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"lp",
"->",
"index",
",",
"new_region",
"->",
"index",
")",
";",
"return",
"true",
";",
"}",
"return",
"ret",
";",
"succeed",
":",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"lp",
"->",
"index",
")",
";",
"remove_eh_landing_pad",
"(",
"lp",
")",
";",
"return",
"true",
";",
"}"
] | Examine the block associated with LP to determine if it's an empty
handler for its EH region. | [
"Examine",
"the",
"block",
"associated",
"with",
"LP",
"to",
"determine",
"if",
"it",
"'",
"s",
"an",
"empty",
"handler",
"for",
"its",
"EH",
"region",
"."
] | [
"/* There can be zero or one edges out of BB. This is the quickest test. */",
"/* Make sure to skip debug statements. */",
"/* If the block is totally empty, look for more unsplitting cases. */",
"/* For the degenerate case of an infinite loop bail out.\n\t If bb has no successors and is totally empty, which can happen e.g.\n\t because of incorrect noreturn attribute, bail out too. */",
"/* The block should consist only of a single RESX statement, modulo a\n preceding call to __builtin_stack_restore if there is no outgoing\n edge, since the call can be eliminated in this case. */",
"/* Determine if there are non-EH edges, or resx edges into the handler. */",
"/* Find the handler that's outer of the empty handler by looking at\n where the RESX instruction was vectored. */",
"/* If there's no destination region within the current function,\n redirection is trivial via removing the throwing statements from\n the EH region, removing the EH edges, and allowing the block\n to go unreachable. */",
"/* If the destination region is a MUST_NOT_THROW, allow the runtime\n to handle the abort and allow the blocks to go unreachable. */",
"/* Try to redirect the EH edges and merge the PHIs into the destination\n landing pad block. If the merge succeeds, we'll already have redirected\n all the EH edges. The handler itself will go unreachable if there were\n no normal edges. */",
"/* Finally, if all input edges are EH edges, then we can (potentially)\n reduce the number of transfers from the runtime by moving the landing\n pad from the original region to the new region. This is a win when\n we remove the last CLEANUP region along a particular exception\n propagation path. Since nothing changes except for the region with\n which the landing pad is associated, the PHI nodes do not need to be\n adjusted at all. */",
"/* ??? The CFG didn't change, but we may have rendered the\n\t old EH region unreachable. Trigger a cleanup there. */"
] | [
{
"param": "lp",
"type": "eh_landing_pad"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "lp",
"type": "eh_landing_pad",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | cleanup_all_empty_eh | bool | static bool
cleanup_all_empty_eh (void)
{
bool changed = false;
eh_landing_pad lp;
int i;
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
if (lp)
changed |= cleanup_empty_eh (lp);
return changed;
} | /* Do a post-order traversal of the EH region tree. Examine each
post_landing_pad block and see if we can eliminate it as empty. */ | Do a post-order traversal of the EH region tree. Examine each
post_landing_pad block and see if we can eliminate it as empty. | [
"Do",
"a",
"post",
"-",
"order",
"traversal",
"of",
"the",
"EH",
"region",
"tree",
".",
"Examine",
"each",
"post_landing_pad",
"block",
"and",
"see",
"if",
"we",
"can",
"eliminate",
"it",
"as",
"empty",
"."
] | static bool
cleanup_all_empty_eh (void)
{
bool changed = false;
eh_landing_pad lp;
int i;
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
if (lp)
changed |= cleanup_empty_eh (lp);
return changed;
} | [
"static",
"bool",
"cleanup_all_empty_eh",
"(",
"void",
")",
"{",
"bool",
"changed",
"=",
"false",
";",
"eh_landing_pad",
"lp",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"1",
";",
"vec_safe_iterate",
"(",
"cfun",
"->",
"eh",
"->",
"lp_array",
",",
"i",
",",
"&",
"lp",
")",
";",
"++",
"i",
")",
"if",
"(",
"lp",
")",
"changed",
"|=",
"cleanup_empty_eh",
"(",
"lp",
")",
";",
"return",
"changed",
";",
"}"
] | Do a post-order traversal of the EH region tree. | [
"Do",
"a",
"post",
"-",
"order",
"traversal",
"of",
"the",
"EH",
"region",
"tree",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3609bca6eacc03cb2b5171ef423f5e5f84e470e1 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-eh.c | [
"BSD-3-Clause"
] | C | execute_cleanup_eh_1 | null | static unsigned int
execute_cleanup_eh_1 (void)
{
/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
looking up unreachable landing pads. */
remove_unreachable_handlers ();
/* Watch out for the region tree vanishing due to all unreachable. */
if (cfun->eh->region_tree)
{
bool changed = false;
if (optimize)
changed |= unsplit_all_eh ();
changed |= cleanup_all_empty_eh ();
if (changed)
{
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
/* We delayed all basic block deletion, as we may have performed
cleanups on EH edges while non-EH edges were still present. */
delete_unreachable_blocks ();
/* We manipulated the landing pads. Remove any region that no
longer has a landing pad. */
remove_unreachable_handlers_no_lp ();
return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
}
}
return 0;
} | /* Perform cleanups and lowering of exception handling
1) cleanups regions with handlers doing nothing are optimized out
2) MUST_NOT_THROW regions that became dead because of 1) are optimized out
3) Info about regions that are containing instructions, and regions
reachable via local EH edges is collected
4) Eh tree is pruned for regions no longer necessary.
TODO: Push MUST_NOT_THROW regions to the root of the EH tree.
Unify those that have the same failure decl and locus.
*/ | Perform cleanups and lowering of exception handling
1) cleanups regions with handlers doing nothing are optimized out
2) MUST_NOT_THROW regions that became dead because of 1) are optimized out
3) Info about regions that are containing instructions, and regions
reachable via local EH edges is collected
4) Eh tree is pruned for regions no longer necessary.
Push MUST_NOT_THROW regions to the root of the EH tree.
Unify those that have the same failure decl and locus. | [
"Perform",
"cleanups",
"and",
"lowering",
"of",
"exception",
"handling",
"1",
")",
"cleanups",
"regions",
"with",
"handlers",
"doing",
"nothing",
"are",
"optimized",
"out",
"2",
")",
"MUST_NOT_THROW",
"regions",
"that",
"became",
"dead",
"because",
"of",
"1",
")",
"are",
"optimized",
"out",
"3",
")",
"Info",
"about",
"regions",
"that",
"are",
"containing",
"instructions",
"and",
"regions",
"reachable",
"via",
"local",
"EH",
"edges",
"is",
"collected",
"4",
")",
"Eh",
"tree",
"is",
"pruned",
"for",
"regions",
"no",
"longer",
"necessary",
".",
"Push",
"MUST_NOT_THROW",
"regions",
"to",
"the",
"root",
"of",
"the",
"EH",
"tree",
".",
"Unify",
"those",
"that",
"have",
"the",
"same",
"failure",
"decl",
"and",
"locus",
"."
] | static unsigned int
execute_cleanup_eh_1 (void)
{
remove_unreachable_handlers ();
if (cfun->eh->region_tree)
{
bool changed = false;
if (optimize)
changed |= unsplit_all_eh ();
changed |= cleanup_all_empty_eh ();
if (changed)
{
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
delete_unreachable_blocks ();
remove_unreachable_handlers_no_lp ();
return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
}
}
return 0;
} | [
"static",
"unsigned",
"int",
"execute_cleanup_eh_1",
"(",
"void",
")",
"{",
"remove_unreachable_handlers",
"(",
")",
";",
"if",
"(",
"cfun",
"->",
"eh",
"->",
"region_tree",
")",
"{",
"bool",
"changed",
"=",
"false",
";",
"if",
"(",
"optimize",
")",
"changed",
"|=",
"unsplit_all_eh",
"(",
")",
";",
"changed",
"|=",
"cleanup_all_empty_eh",
"(",
")",
";",
"if",
"(",
"changed",
")",
"{",
"free_dominance_info",
"(",
"CDI_DOMINATORS",
")",
";",
"free_dominance_info",
"(",
"CDI_POST_DOMINATORS",
")",
";",
"delete_unreachable_blocks",
"(",
")",
";",
"remove_unreachable_handlers_no_lp",
"(",
")",
";",
"return",
"TODO_cleanup_cfg",
"|",
"TODO_update_ssa_only_virtuals",
";",
"}",
"}",
"return",
"0",
";",
"}"
] | Perform cleanups and lowering of exception handling
1) cleanups regions with handlers doing nothing are optimized out
2) MUST_NOT_THROW regions that became dead because of 1) are optimized out
3) Info about regions that are containing instructions, and regions
reachable via local EH edges is collected
4) Eh tree is pruned for regions no longer necessary. | [
"Perform",
"cleanups",
"and",
"lowering",
"of",
"exception",
"handling",
"1",
")",
"cleanups",
"regions",
"with",
"handlers",
"doing",
"nothing",
"are",
"optimized",
"out",
"2",
")",
"MUST_NOT_THROW",
"regions",
"that",
"became",
"dead",
"because",
"of",
"1",
")",
"are",
"optimized",
"out",
"3",
")",
"Info",
"about",
"regions",
"that",
"are",
"containing",
"instructions",
"and",
"regions",
"reachable",
"via",
"local",
"EH",
"edges",
"is",
"collected",
"4",
")",
"Eh",
"tree",
"is",
"pruned",
"for",
"regions",
"no",
"longer",
"necessary",
"."
] | [
"/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die\n looking up unreachable landing pads. */",
"/* Watch out for the region tree vanishing due to all unreachable. */",
"/* We delayed all basic block deletion, as we may have performed\n\t cleanups on EH edges while non-EH edges were still present. */",
"/* We manipulated the landing pads. Remove any region that no\n\t longer has a landing pad. */"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_newhook | int | static int
ng_pptpgre_newhook(node_p node, hook_p hook, const char *name)
{
const priv_p priv = node->private;
hook_p *hookPtr;
/* Check hook name */
if (strcmp(name, NG_PPTPGRE_HOOK_UPPER) == 0)
hookPtr = &priv->upper;
else if (strcmp(name, NG_PPTPGRE_HOOK_LOWER) == 0)
hookPtr = &priv->lower;
else
return (EINVAL);
/* See if already connected */
if (*hookPtr != NULL)
return (EISCONN);
/* OK */
*hookPtr = hook;
return (0);
} | /*
* Give our OK for a hook to be added.
*/ | Give our OK for a hook to be added. | [
"Give",
"our",
"OK",
"for",
"a",
"hook",
"to",
"be",
"added",
"."
] | static int
ng_pptpgre_newhook(node_p node, hook_p hook, const char *name)
{
const priv_p priv = node->private;
hook_p *hookPtr;
if (strcmp(name, NG_PPTPGRE_HOOK_UPPER) == 0)
hookPtr = &priv->upper;
else if (strcmp(name, NG_PPTPGRE_HOOK_LOWER) == 0)
hookPtr = &priv->lower;
else
return (EINVAL);
if (*hookPtr != NULL)
return (EISCONN);
*hookPtr = hook;
return (0);
} | [
"static",
"int",
"ng_pptpgre_newhook",
"(",
"node_p",
"node",
",",
"hook_p",
"hook",
",",
"const",
"char",
"*",
"name",
")",
"{",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"hook_p",
"*",
"hookPtr",
";",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_PPTPGRE_HOOK_UPPER",
")",
"==",
"0",
")",
"hookPtr",
"=",
"&",
"priv",
"->",
"upper",
";",
"else",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_PPTPGRE_HOOK_LOWER",
")",
"==",
"0",
")",
"hookPtr",
"=",
"&",
"priv",
"->",
"lower",
";",
"else",
"return",
"(",
"EINVAL",
")",
";",
"if",
"(",
"*",
"hookPtr",
"!=",
"NULL",
")",
"return",
"(",
"EISCONN",
")",
";",
"*",
"hookPtr",
"=",
"hook",
";",
"return",
"(",
"0",
")",
";",
"}"
] | Give our OK for a hook to be added. | [
"Give",
"our",
"OK",
"for",
"a",
"hook",
"to",
"be",
"added",
"."
] | [
"/* Check hook name */",
"/* See if already connected */",
"/* OK */"
] | [
{
"param": "node",
"type": "node_p"
},
{
"param": "hook",
"type": "hook_p"
},
{
"param": "name",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "hook",
"type": "hook_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_rcvdata | int | static int
ng_pptpgre_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
{
const node_p node = hook->node;
const priv_p priv = node->private;
/* If not configured, reject */
if (!priv->conf.enabled) {
NG_FREE_DATA(m, meta);
return (ENXIO);
}
/* Treat as xmit or recv data */
if (hook == priv->upper)
return ng_pptpgre_xmit(node, m, meta);
if (hook == priv->lower)
return ng_pptpgre_recv(node, m, meta);
panic("%s: weird hook", __func__);
} | /*
* Receive incoming data on a hook.
*/ | Receive incoming data on a hook. | [
"Receive",
"incoming",
"data",
"on",
"a",
"hook",
"."
] | static int
ng_pptpgre_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
{
const node_p node = hook->node;
const priv_p priv = node->private;
if (!priv->conf.enabled) {
NG_FREE_DATA(m, meta);
return (ENXIO);
}
if (hook == priv->upper)
return ng_pptpgre_xmit(node, m, meta);
if (hook == priv->lower)
return ng_pptpgre_recv(node, m, meta);
panic("%s: weird hook", __func__);
} | [
"static",
"int",
"ng_pptpgre_rcvdata",
"(",
"hook_p",
"hook",
",",
"struct",
"mbuf",
"*",
"m",
",",
"meta_p",
"meta",
")",
"{",
"const",
"node_p",
"node",
"=",
"hook",
"->",
"node",
";",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"if",
"(",
"!",
"priv",
"->",
"conf",
".",
"enabled",
")",
"{",
"NG_FREE_DATA",
"(",
"m",
",",
"meta",
")",
";",
"return",
"(",
"ENXIO",
")",
";",
"}",
"if",
"(",
"hook",
"==",
"priv",
"->",
"upper",
")",
"return",
"ng_pptpgre_xmit",
"(",
"node",
",",
"m",
",",
"meta",
")",
";",
"if",
"(",
"hook",
"==",
"priv",
"->",
"lower",
")",
"return",
"ng_pptpgre_recv",
"(",
"node",
",",
"m",
",",
"meta",
")",
";",
"panic",
"(",
"\"",
"\"",
",",
"__func__",
")",
";",
"}"
] | Receive incoming data on a hook. | [
"Receive",
"incoming",
"data",
"on",
"a",
"hook",
"."
] | [
"/* If not configured, reject */",
"/* Treat as xmit or recv data */"
] | [
{
"param": "hook",
"type": "hook_p"
},
{
"param": "m",
"type": "struct mbuf"
},
{
"param": "meta",
"type": "meta_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "hook",
"type": "hook_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "m",
"type": "struct mbuf",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "meta",
"type": "meta_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_start_recv_ack_timer | void | static void
ng_pptpgre_start_recv_ack_timer(node_p node)
{
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
int remain, ticks;
/* Compute how long until oldest unack'd packet times out,
and reset the timer to that time. */
KASSERT(a->rackTimerPtr == NULL, ("%s: rackTimer", __func__));
remain = (a->timeSent[0] + a->ato) - ng_pptpgre_time(node);
if (remain < 0)
remain = 0;
#ifdef DEBUG_RAT
a->timerLength = remain;
a->timerStart = ng_pptpgre_time(node);
#endif
/* Start new timer */
a->rackTimerPtr = kmalloc(sizeof(node_p), M_NETGRAPH, M_NOWAIT);
if (a->rackTimerPtr == NULL) {
priv->stats.memoryFailures++;
return; /* XXX potential hang here */
}
*a->rackTimerPtr = node; /* ensures the correct timeout event */
node->refs++;
priv->timers++;
/* Be conservative: timeout can happen up to 1 tick early */
ticks = (((remain * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE) + 1;
callout_reset(&a->rackTimer, ticks,
ng_pptpgre_recv_ack_timeout, a->rackTimerPtr);
} | /*
* Start a timer for the peer's acknowledging our oldest unacknowledged
* sequence number. If we get an ack for this sequence number before
* the timer goes off, we cancel the timer. Resets currently running
* recv ack timer, if any.
*/ | Start a timer for the peer's acknowledging our oldest unacknowledged
sequence number. If we get an ack for this sequence number before
the timer goes off, we cancel the timer. Resets currently running
recv ack timer, if any. | [
"Start",
"a",
"timer",
"for",
"the",
"peer",
"'",
"s",
"acknowledging",
"our",
"oldest",
"unacknowledged",
"sequence",
"number",
".",
"If",
"we",
"get",
"an",
"ack",
"for",
"this",
"sequence",
"number",
"before",
"the",
"timer",
"goes",
"off",
"we",
"cancel",
"the",
"timer",
".",
"Resets",
"currently",
"running",
"recv",
"ack",
"timer",
"if",
"any",
"."
] | static void
ng_pptpgre_start_recv_ack_timer(node_p node)
{
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
int remain, ticks;
KASSERT(a->rackTimerPtr == NULL, ("%s: rackTimer", __func__));
remain = (a->timeSent[0] + a->ato) - ng_pptpgre_time(node);
if (remain < 0)
remain = 0;
#ifdef DEBUG_RAT
a->timerLength = remain;
a->timerStart = ng_pptpgre_time(node);
#endif
a->rackTimerPtr = kmalloc(sizeof(node_p), M_NETGRAPH, M_NOWAIT);
if (a->rackTimerPtr == NULL) {
priv->stats.memoryFailures++;
return;
}
*a->rackTimerPtr = node;
node->refs++;
priv->timers++;
ticks = (((remain * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE) + 1;
callout_reset(&a->rackTimer, ticks,
ng_pptpgre_recv_ack_timeout, a->rackTimerPtr);
} | [
"static",
"void",
"ng_pptpgre_start_recv_ack_timer",
"(",
"node_p",
"node",
")",
"{",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"struct",
"ng_pptpgre_ackp",
"*",
"const",
"a",
"=",
"&",
"priv",
"->",
"ackp",
";",
"int",
"remain",
",",
"ticks",
";",
"KASSERT",
"(",
"a",
"->",
"rackTimerPtr",
"==",
"NULL",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"remain",
"=",
"(",
"a",
"->",
"timeSent",
"[",
"0",
"]",
"+",
"a",
"->",
"ato",
")",
"-",
"ng_pptpgre_time",
"(",
"node",
")",
";",
"if",
"(",
"remain",
"<",
"0",
")",
"remain",
"=",
"0",
";",
"#ifdef",
"DEBUG_RAT",
"a",
"->",
"timerLength",
"=",
"remain",
";",
"a",
"->",
"timerStart",
"=",
"ng_pptpgre_time",
"(",
"node",
")",
";",
"#endif",
"a",
"->",
"rackTimerPtr",
"=",
"kmalloc",
"(",
"sizeof",
"(",
"node_p",
")",
",",
"M_NETGRAPH",
",",
"M_NOWAIT",
")",
";",
"if",
"(",
"a",
"->",
"rackTimerPtr",
"==",
"NULL",
")",
"{",
"priv",
"->",
"stats",
".",
"memoryFailures",
"++",
";",
"return",
";",
"}",
"*",
"a",
"->",
"rackTimerPtr",
"=",
"node",
";",
"node",
"->",
"refs",
"++",
";",
"priv",
"->",
"timers",
"++",
";",
"ticks",
"=",
"(",
"(",
"(",
"remain",
"*",
"hz",
")",
"+",
"PPTP_TIME_SCALE",
"-",
"1",
")",
"/",
"PPTP_TIME_SCALE",
")",
"+",
"1",
";",
"callout_reset",
"(",
"&",
"a",
"->",
"rackTimer",
",",
"ticks",
",",
"ng_pptpgre_recv_ack_timeout",
",",
"a",
"->",
"rackTimerPtr",
")",
";",
"}"
] | Start a timer for the peer's acknowledging our oldest unacknowledged
sequence number. | [
"Start",
"a",
"timer",
"for",
"the",
"peer",
"'",
"s",
"acknowledging",
"our",
"oldest",
"unacknowledged",
"sequence",
"number",
"."
] | [
"/* Compute how long until oldest unack'd packet times out,\n\t and reset the timer to that time. */",
"/* Start new timer */",
"/* XXX potential hang here */",
"/* ensures the correct timeout event */",
"/* Be conservative: timeout can happen up to 1 tick early */"
] | [
{
"param": "node",
"type": "node_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_recv_ack_timeout | void | static void
ng_pptpgre_recv_ack_timeout(void *arg)
{
const node_p node = *((node_p *)arg);
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
crit_enter();
/* This complicated stuff is needed to avoid race conditions */
kfree(arg, M_NETGRAPH);
KASSERT(node->refs > 0, ("%s: no refs", __func__));
KASSERT(priv != NULL, ("%s: priv=NULL", __func__));
priv->timers--;
if ((node->flags & NG_INVALID) != 0) { /* shutdown race condition */
if (priv->timers == 0) {
kfree(priv, M_NETGRAPH);
node->private = NULL;
}
ng_unref(node);
crit_exit();
return;
}
if (arg != a->rackTimerPtr) { /* timer stopped race condition */
ng_unref(node);
crit_exit();
return;
}
a->rackTimerPtr = NULL;
/* Update adaptive timeout stuff */
priv->stats.recvAckTimeouts++;
a->rtt = PPTP_ACK_DELTA(a->rtt);
a->ato = a->rtt + PPTP_ACK_CHI(a->dev);
if (a->ato > PPTP_MAX_TIMEOUT)
a->ato = PPTP_MAX_TIMEOUT;
if (a->ato < PPTP_MIN_TIMEOUT)
a->ato = PPTP_MIN_TIMEOUT;
#ifdef DEBUG_RAT
log(LOG_DEBUG,
"RAT now=%d seq=0x%x sent=%d tstart=%d tlen=%d ato=%d\n",
(int)ng_pptpgre_time(node), priv->recvAck + 1,
(int)a->timeSent[0], (int)a->timerStart, (int)a->timerLength, a->ato);
#endif
/* Reset ack and sliding window */
priv->recvAck = priv->xmitSeq; /* pretend we got the ack */
a->xmitWin = (a->xmitWin + 1) / 2; /* shrink transmit window */
a->winAck = priv->recvAck + a->xmitWin; /* reset win expand time */
ng_unref(node);
crit_exit();
} | /*
* The peer has failed to acknowledge the oldest unacknowledged sequence
* number within the time allotted. Update our adaptive timeout parameters
* and reset/restart the recv ack timer.
*/ | The peer has failed to acknowledge the oldest unacknowledged sequence
number within the time allotted. Update our adaptive timeout parameters
and reset/restart the recv ack timer. | [
"The",
"peer",
"has",
"failed",
"to",
"acknowledge",
"the",
"oldest",
"unacknowledged",
"sequence",
"number",
"within",
"the",
"time",
"allotted",
".",
"Update",
"our",
"adaptive",
"timeout",
"parameters",
"and",
"reset",
"/",
"restart",
"the",
"recv",
"ack",
"timer",
"."
] | static void
ng_pptpgre_recv_ack_timeout(void *arg)
{
const node_p node = *((node_p *)arg);
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
crit_enter();
kfree(arg, M_NETGRAPH);
KASSERT(node->refs > 0, ("%s: no refs", __func__));
KASSERT(priv != NULL, ("%s: priv=NULL", __func__));
priv->timers--;
if ((node->flags & NG_INVALID) != 0) {
if (priv->timers == 0) {
kfree(priv, M_NETGRAPH);
node->private = NULL;
}
ng_unref(node);
crit_exit();
return;
}
if (arg != a->rackTimerPtr) {
ng_unref(node);
crit_exit();
return;
}
a->rackTimerPtr = NULL;
priv->stats.recvAckTimeouts++;
a->rtt = PPTP_ACK_DELTA(a->rtt);
a->ato = a->rtt + PPTP_ACK_CHI(a->dev);
if (a->ato > PPTP_MAX_TIMEOUT)
a->ato = PPTP_MAX_TIMEOUT;
if (a->ato < PPTP_MIN_TIMEOUT)
a->ato = PPTP_MIN_TIMEOUT;
#ifdef DEBUG_RAT
log(LOG_DEBUG,
"RAT now=%d seq=0x%x sent=%d tstart=%d tlen=%d ato=%d\n",
(int)ng_pptpgre_time(node), priv->recvAck + 1,
(int)a->timeSent[0], (int)a->timerStart, (int)a->timerLength, a->ato);
#endif
priv->recvAck = priv->xmitSeq;
a->xmitWin = (a->xmitWin + 1) / 2;
a->winAck = priv->recvAck + a->xmitWin;
ng_unref(node);
crit_exit();
} | [
"static",
"void",
"ng_pptpgre_recv_ack_timeout",
"(",
"void",
"*",
"arg",
")",
"{",
"const",
"node_p",
"node",
"=",
"*",
"(",
"(",
"node_p",
"*",
")",
"arg",
")",
";",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"struct",
"ng_pptpgre_ackp",
"*",
"const",
"a",
"=",
"&",
"priv",
"->",
"ackp",
";",
"crit_enter",
"(",
")",
";",
"kfree",
"(",
"arg",
",",
"M_NETGRAPH",
")",
";",
"KASSERT",
"(",
"node",
"->",
"refs",
">",
"0",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"KASSERT",
"(",
"priv",
"!=",
"NULL",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"priv",
"->",
"timers",
"--",
";",
"if",
"(",
"(",
"node",
"->",
"flags",
"&",
"NG_INVALID",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"priv",
"->",
"timers",
"==",
"0",
")",
"{",
"kfree",
"(",
"priv",
",",
"M_NETGRAPH",
")",
";",
"node",
"->",
"private",
"=",
"NULL",
";",
"}",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"arg",
"!=",
"a",
"->",
"rackTimerPtr",
")",
"{",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"return",
";",
"}",
"a",
"->",
"rackTimerPtr",
"=",
"NULL",
";",
"priv",
"->",
"stats",
".",
"recvAckTimeouts",
"++",
";",
"a",
"->",
"rtt",
"=",
"PPTP_ACK_DELTA",
"(",
"a",
"->",
"rtt",
")",
";",
"a",
"->",
"ato",
"=",
"a",
"->",
"rtt",
"+",
"PPTP_ACK_CHI",
"(",
"a",
"->",
"dev",
")",
";",
"if",
"(",
"a",
"->",
"ato",
">",
"PPTP_MAX_TIMEOUT",
")",
"a",
"->",
"ato",
"=",
"PPTP_MAX_TIMEOUT",
";",
"if",
"(",
"a",
"->",
"ato",
"<",
"PPTP_MIN_TIMEOUT",
")",
"a",
"->",
"ato",
"=",
"PPTP_MIN_TIMEOUT",
";",
"#ifdef",
"DEBUG_RAT",
"log",
"(",
"LOG_DEBUG",
",",
"\"",
"\\n",
"\"",
",",
"(",
"int",
")",
"ng_pptpgre_time",
"(",
"node",
")",
",",
"priv",
"->",
"recvAck",
"+",
"1",
",",
"(",
"int",
")",
"a",
"->",
"timeSent",
"[",
"0",
"]",
",",
"(",
"int",
")",
"a",
"->",
"timerStart",
",",
"(",
"int",
")",
"a",
"->",
"timerLength",
",",
"a",
"->",
"ato",
")",
";",
"#endif",
"priv",
"->",
"recvAck",
"=",
"priv",
"->",
"xmitSeq",
";",
"a",
"->",
"xmitWin",
"=",
"(",
"a",
"->",
"xmitWin",
"+",
"1",
")",
"/",
"2",
";",
"a",
"->",
"winAck",
"=",
"priv",
"->",
"recvAck",
"+",
"a",
"->",
"xmitWin",
";",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"}"
] | The peer has failed to acknowledge the oldest unacknowledged sequence
number within the time allotted. | [
"The",
"peer",
"has",
"failed",
"to",
"acknowledge",
"the",
"oldest",
"unacknowledged",
"sequence",
"number",
"within",
"the",
"time",
"allotted",
"."
] | [
"/* This complicated stuff is needed to avoid race conditions */",
"/* shutdown race condition */",
"/* timer stopped race condition */",
"/* Update adaptive timeout stuff */",
"/* Reset ack and sliding window */",
"/* pretend we got the ack */",
"/* shrink transmit window */",
"/* reset win expand time */"
] | [
{
"param": "arg",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "arg",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_start_send_ack_timer | void | static void
ng_pptpgre_start_send_ack_timer(node_p node, int ackTimeout)
{
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
int ticks;
/* Start new timer */
KASSERT(a->sackTimerPtr == NULL, ("%s: sackTimer", __func__));
a->sackTimerPtr = kmalloc(sizeof(node_p), M_NETGRAPH, M_NOWAIT);
if (a->sackTimerPtr == NULL) {
priv->stats.memoryFailures++;
return; /* XXX potential hang here */
}
*a->sackTimerPtr = node; /* ensures the correct timeout event */
node->refs++;
priv->timers++;
/* Be conservative: timeout can happen up to 1 tick early */
ticks = (((ackTimeout * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE);
callout_reset(&a->sackTimer, ticks,
ng_pptpgre_send_ack_timeout, a->sackTimerPtr);
} | /*
* Start the send ack timer. This assumes the timer is not
* already running.
*/ | Start the send ack timer. This assumes the timer is not
already running. | [
"Start",
"the",
"send",
"ack",
"timer",
".",
"This",
"assumes",
"the",
"timer",
"is",
"not",
"already",
"running",
"."
] | static void
ng_pptpgre_start_send_ack_timer(node_p node, int ackTimeout)
{
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
int ticks;
KASSERT(a->sackTimerPtr == NULL, ("%s: sackTimer", __func__));
a->sackTimerPtr = kmalloc(sizeof(node_p), M_NETGRAPH, M_NOWAIT);
if (a->sackTimerPtr == NULL) {
priv->stats.memoryFailures++;
return;
}
*a->sackTimerPtr = node;
node->refs++;
priv->timers++;
ticks = (((ackTimeout * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE);
callout_reset(&a->sackTimer, ticks,
ng_pptpgre_send_ack_timeout, a->sackTimerPtr);
} | [
"static",
"void",
"ng_pptpgre_start_send_ack_timer",
"(",
"node_p",
"node",
",",
"int",
"ackTimeout",
")",
"{",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"struct",
"ng_pptpgre_ackp",
"*",
"const",
"a",
"=",
"&",
"priv",
"->",
"ackp",
";",
"int",
"ticks",
";",
"KASSERT",
"(",
"a",
"->",
"sackTimerPtr",
"==",
"NULL",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"a",
"->",
"sackTimerPtr",
"=",
"kmalloc",
"(",
"sizeof",
"(",
"node_p",
")",
",",
"M_NETGRAPH",
",",
"M_NOWAIT",
")",
";",
"if",
"(",
"a",
"->",
"sackTimerPtr",
"==",
"NULL",
")",
"{",
"priv",
"->",
"stats",
".",
"memoryFailures",
"++",
";",
"return",
";",
"}",
"*",
"a",
"->",
"sackTimerPtr",
"=",
"node",
";",
"node",
"->",
"refs",
"++",
";",
"priv",
"->",
"timers",
"++",
";",
"ticks",
"=",
"(",
"(",
"(",
"ackTimeout",
"*",
"hz",
")",
"+",
"PPTP_TIME_SCALE",
"-",
"1",
")",
"/",
"PPTP_TIME_SCALE",
")",
";",
"callout_reset",
"(",
"&",
"a",
"->",
"sackTimer",
",",
"ticks",
",",
"ng_pptpgre_send_ack_timeout",
",",
"a",
"->",
"sackTimerPtr",
")",
";",
"}"
] | Start the send ack timer. | [
"Start",
"the",
"send",
"ack",
"timer",
"."
] | [
"/* Start new timer */",
"/* XXX potential hang here */",
"/* ensures the correct timeout event */",
"/* Be conservative: timeout can happen up to 1 tick early */"
] | [
{
"param": "node",
"type": "node_p"
},
{
"param": "ackTimeout",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ackTimeout",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_send_ack_timeout | void | static void
ng_pptpgre_send_ack_timeout(void *arg)
{
const node_p node = *((node_p *)arg);
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
crit_enter();
/* This complicated stuff is needed to avoid race conditions */
kfree(arg, M_NETGRAPH);
KASSERT(node->refs > 0, ("%s: no refs", __func__));
KASSERT(priv != NULL, ("%s: priv=NULL", __func__));
priv->timers--;
if ((node->flags & NG_INVALID) != 0) { /* shutdown race condition */
if (priv->timers == 0) {
kfree(priv, M_NETGRAPH);
node->private = NULL;
}
ng_unref(node);
crit_exit();
return;
}
if (a->sackTimerPtr != arg) { /* timer stopped race condition */
ng_unref(node);
crit_exit();
return;
}
a->sackTimerPtr = NULL;
/* Send a frame with an ack but no payload */
ng_pptpgre_xmit(node, NULL, NULL);
ng_unref(node);
crit_exit();
} | /*
* We've waited as long as we're willing to wait before sending an
* acknowledgement to the peer for received frames. We had hoped to
* be able to piggy back our acknowledgement on an outgoing data frame,
* but apparently there haven't been any since. So send the ack now.
*/ | We've waited as long as we're willing to wait before sending an
acknowledgement to the peer for received frames. We had hoped to
be able to piggy back our acknowledgement on an outgoing data frame,
but apparently there haven't been any since. So send the ack now. | [
"We",
"'",
"ve",
"waited",
"as",
"long",
"as",
"we",
"'",
"re",
"willing",
"to",
"wait",
"before",
"sending",
"an",
"acknowledgement",
"to",
"the",
"peer",
"for",
"received",
"frames",
".",
"We",
"had",
"hoped",
"to",
"be",
"able",
"to",
"piggy",
"back",
"our",
"acknowledgement",
"on",
"an",
"outgoing",
"data",
"frame",
"but",
"apparently",
"there",
"haven",
"'",
"t",
"been",
"any",
"since",
".",
"So",
"send",
"the",
"ack",
"now",
"."
] | static void
ng_pptpgre_send_ack_timeout(void *arg)
{
const node_p node = *((node_p *)arg);
const priv_p priv = node->private;
struct ng_pptpgre_ackp *const a = &priv->ackp;
crit_enter();
kfree(arg, M_NETGRAPH);
KASSERT(node->refs > 0, ("%s: no refs", __func__));
KASSERT(priv != NULL, ("%s: priv=NULL", __func__));
priv->timers--;
if ((node->flags & NG_INVALID) != 0) {
if (priv->timers == 0) {
kfree(priv, M_NETGRAPH);
node->private = NULL;
}
ng_unref(node);
crit_exit();
return;
}
if (a->sackTimerPtr != arg) {
ng_unref(node);
crit_exit();
return;
}
a->sackTimerPtr = NULL;
ng_pptpgre_xmit(node, NULL, NULL);
ng_unref(node);
crit_exit();
} | [
"static",
"void",
"ng_pptpgre_send_ack_timeout",
"(",
"void",
"*",
"arg",
")",
"{",
"const",
"node_p",
"node",
"=",
"*",
"(",
"(",
"node_p",
"*",
")",
"arg",
")",
";",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"struct",
"ng_pptpgre_ackp",
"*",
"const",
"a",
"=",
"&",
"priv",
"->",
"ackp",
";",
"crit_enter",
"(",
")",
";",
"kfree",
"(",
"arg",
",",
"M_NETGRAPH",
")",
";",
"KASSERT",
"(",
"node",
"->",
"refs",
">",
"0",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"KASSERT",
"(",
"priv",
"!=",
"NULL",
",",
"(",
"\"",
"\"",
",",
"__func__",
")",
")",
";",
"priv",
"->",
"timers",
"--",
";",
"if",
"(",
"(",
"node",
"->",
"flags",
"&",
"NG_INVALID",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"priv",
"->",
"timers",
"==",
"0",
")",
"{",
"kfree",
"(",
"priv",
",",
"M_NETGRAPH",
")",
";",
"node",
"->",
"private",
"=",
"NULL",
";",
"}",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"a",
"->",
"sackTimerPtr",
"!=",
"arg",
")",
"{",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"return",
";",
"}",
"a",
"->",
"sackTimerPtr",
"=",
"NULL",
";",
"ng_pptpgre_xmit",
"(",
"node",
",",
"NULL",
",",
"NULL",
")",
";",
"ng_unref",
"(",
"node",
")",
";",
"crit_exit",
"(",
")",
";",
"}"
] | We've waited as long as we're willing to wait before sending an
acknowledgement to the peer for received frames. | [
"We",
"'",
"ve",
"waited",
"as",
"long",
"as",
"we",
"'",
"re",
"willing",
"to",
"wait",
"before",
"sending",
"an",
"acknowledgement",
"to",
"the",
"peer",
"for",
"received",
"frames",
"."
] | [
"/* This complicated stuff is needed to avoid race conditions */",
"/* shutdown race condition */",
"/* timer stopped race condition */",
"/* Send a frame with an ack but no payload */"
] | [
{
"param": "arg",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "arg",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e08f94f5f88402eaf28af51c3d79edca48f6f585 | atrens/DragonFlyBSD-src | sys/netgraph/pptpgre/ng_pptpgre.c | [
"BSD-3-Clause"
] | C | ng_pptpgre_time | pptptime_t | static pptptime_t
ng_pptpgre_time(node_p node)
{
const priv_p priv = node->private;
struct timeval tv;
pptptime_t t;
microuptime(&tv);
if (tv.tv_sec < priv->startTime.tv_sec
|| (tv.tv_sec == priv->startTime.tv_sec
&& tv.tv_usec < priv->startTime.tv_usec))
return (0);
timevalsub(&tv, &priv->startTime);
t = (pptptime_t)tv.tv_sec * PPTP_TIME_SCALE;
t += (pptptime_t)tv.tv_usec / (1000000 / PPTP_TIME_SCALE);
return(t);
} | /*
* Return the current time scaled & translated to our internally used format.
*/ | Return the current time scaled & translated to our internally used format. | [
"Return",
"the",
"current",
"time",
"scaled",
"&",
"translated",
"to",
"our",
"internally",
"used",
"format",
"."
] | static pptptime_t
ng_pptpgre_time(node_p node)
{
const priv_p priv = node->private;
struct timeval tv;
pptptime_t t;
microuptime(&tv);
if (tv.tv_sec < priv->startTime.tv_sec
|| (tv.tv_sec == priv->startTime.tv_sec
&& tv.tv_usec < priv->startTime.tv_usec))
return (0);
timevalsub(&tv, &priv->startTime);
t = (pptptime_t)tv.tv_sec * PPTP_TIME_SCALE;
t += (pptptime_t)tv.tv_usec / (1000000 / PPTP_TIME_SCALE);
return(t);
} | [
"static",
"pptptime_t",
"ng_pptpgre_time",
"(",
"node_p",
"node",
")",
"{",
"const",
"priv_p",
"priv",
"=",
"node",
"->",
"private",
";",
"struct",
"timeval",
"tv",
";",
"pptptime_t",
"t",
";",
"microuptime",
"(",
"&",
"tv",
")",
";",
"if",
"(",
"tv",
".",
"tv_sec",
"<",
"priv",
"->",
"startTime",
".",
"tv_sec",
"||",
"(",
"tv",
".",
"tv_sec",
"==",
"priv",
"->",
"startTime",
".",
"tv_sec",
"&&",
"tv",
".",
"tv_usec",
"<",
"priv",
"->",
"startTime",
".",
"tv_usec",
")",
")",
"return",
"(",
"0",
")",
";",
"timevalsub",
"(",
"&",
"tv",
",",
"&",
"priv",
"->",
"startTime",
")",
";",
"t",
"=",
"(",
"pptptime_t",
")",
"tv",
".",
"tv_sec",
"*",
"PPTP_TIME_SCALE",
";",
"t",
"+=",
"(",
"pptptime_t",
")",
"tv",
".",
"tv_usec",
"/",
"(",
"1000000",
"/",
"PPTP_TIME_SCALE",
")",
";",
"return",
"(",
"t",
")",
";",
"}"
] | Return the current time scaled & translated to our internally used format. | [
"Return",
"the",
"current",
"time",
"scaled",
"&",
"translated",
"to",
"our",
"internally",
"used",
"format",
"."
] | [] | [
{
"param": "node",
"type": "node_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a489058904b799df8d5e0b9de34de67f4179b0cb | atrens/DragonFlyBSD-src | contrib/binutils-2.27/ld/ldcref.c | [
"BSD-3-Clause"
] | C | cref_hash_newfunc | null | static struct bfd_hash_entry *
cref_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
{
struct cref_hash_entry *ret = (struct cref_hash_entry *) entry;
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == NULL)
ret = ((struct cref_hash_entry *)
bfd_hash_allocate (table, sizeof (struct cref_hash_entry)));
if (ret == NULL)
return NULL;
/* Call the allocation method of the superclass. */
ret = ((struct cref_hash_entry *)
bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
if (ret != NULL)
{
/* Set local fields. */
ret->demangled = NULL;
ret->refs = NULL;
/* Keep a count of the number of entries created in the hash
table. */
++cref_symcount;
}
return &ret->root;
} | /* Create an entry in a cref hash table. */ | Create an entry in a cref hash table. | [
"Create",
"an",
"entry",
"in",
"a",
"cref",
"hash",
"table",
"."
] | static struct bfd_hash_entry *
cref_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
{
struct cref_hash_entry *ret = (struct cref_hash_entry *) entry;
if (ret == NULL)
ret = ((struct cref_hash_entry *)
bfd_hash_allocate (table, sizeof (struct cref_hash_entry)));
if (ret == NULL)
return NULL;
ret = ((struct cref_hash_entry *)
bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
if (ret != NULL)
{
ret->demangled = NULL;
ret->refs = NULL;
++cref_symcount;
}
return &ret->root;
} | [
"static",
"struct",
"bfd_hash_entry",
"*",
"cref_hash_newfunc",
"(",
"struct",
"bfd_hash_entry",
"*",
"entry",
",",
"struct",
"bfd_hash_table",
"*",
"table",
",",
"const",
"char",
"*",
"string",
")",
"{",
"struct",
"cref_hash_entry",
"*",
"ret",
"=",
"(",
"struct",
"cref_hash_entry",
"*",
")",
"entry",
";",
"if",
"(",
"ret",
"==",
"NULL",
")",
"ret",
"=",
"(",
"(",
"struct",
"cref_hash_entry",
"*",
")",
"bfd_hash_allocate",
"(",
"table",
",",
"sizeof",
"(",
"struct",
"cref_hash_entry",
")",
")",
")",
";",
"if",
"(",
"ret",
"==",
"NULL",
")",
"return",
"NULL",
";",
"ret",
"=",
"(",
"(",
"struct",
"cref_hash_entry",
"*",
")",
"bfd_hash_newfunc",
"(",
"(",
"struct",
"bfd_hash_entry",
"*",
")",
"ret",
",",
"table",
",",
"string",
")",
")",
";",
"if",
"(",
"ret",
"!=",
"NULL",
")",
"{",
"ret",
"->",
"demangled",
"=",
"NULL",
";",
"ret",
"->",
"refs",
"=",
"NULL",
";",
"++",
"cref_symcount",
";",
"}",
"return",
"&",
"ret",
"->",
"root",
";",
"}"
] | Create an entry in a cref hash table. | [
"Create",
"an",
"entry",
"in",
"a",
"cref",
"hash",
"table",
"."
] | [
"/* Allocate the structure if it has not already been allocated by a\n subclass. */",
"/* Call the allocation method of the superclass. */",
"/* Set local fields. */",
"/* Keep a count of the number of entries created in the hash\n\t table. */"
] | [
{
"param": "entry",
"type": "struct bfd_hash_entry"
},
{
"param": "table",
"type": "struct bfd_hash_table"
},
{
"param": "string",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "entry",
"type": "struct bfd_hash_entry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "table",
"type": "struct bfd_hash_table",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "string",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a489058904b799df8d5e0b9de34de67f4179b0cb | atrens/DragonFlyBSD-src | contrib/binutils-2.27/ld/ldcref.c | [
"BSD-3-Clause"
] | C | cref_fill_array | bfd_boolean | static bfd_boolean
cref_fill_array (struct cref_hash_entry *h, void *data)
{
struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data;
ASSERT (h->demangled == NULL);
h->demangled = bfd_demangle (link_info.output_bfd, h->root.string,
DMGL_ANSI | DMGL_PARAMS);
if (h->demangled == NULL)
h->demangled = h->root.string;
**pph = h;
++*pph;
return TRUE;
} | /* Copy the addresses of the hash table entries into an array. This
is called via cref_hash_traverse. We also fill in the demangled
name. */ | Copy the addresses of the hash table entries into an array. This
is called via cref_hash_traverse. We also fill in the demangled
name. | [
"Copy",
"the",
"addresses",
"of",
"the",
"hash",
"table",
"entries",
"into",
"an",
"array",
".",
"This",
"is",
"called",
"via",
"cref_hash_traverse",
".",
"We",
"also",
"fill",
"in",
"the",
"demangled",
"name",
"."
] | static bfd_boolean
cref_fill_array (struct cref_hash_entry *h, void *data)
{
struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data;
ASSERT (h->demangled == NULL);
h->demangled = bfd_demangle (link_info.output_bfd, h->root.string,
DMGL_ANSI | DMGL_PARAMS);
if (h->demangled == NULL)
h->demangled = h->root.string;
**pph = h;
++*pph;
return TRUE;
} | [
"static",
"bfd_boolean",
"cref_fill_array",
"(",
"struct",
"cref_hash_entry",
"*",
"h",
",",
"void",
"*",
"data",
")",
"{",
"struct",
"cref_hash_entry",
"*",
"*",
"*",
"pph",
"=",
"(",
"struct",
"cref_hash_entry",
"*",
"*",
"*",
")",
"data",
";",
"ASSERT",
"(",
"h",
"->",
"demangled",
"==",
"NULL",
")",
";",
"h",
"->",
"demangled",
"=",
"bfd_demangle",
"(",
"link_info",
".",
"output_bfd",
",",
"h",
"->",
"root",
".",
"string",
",",
"DMGL_ANSI",
"|",
"DMGL_PARAMS",
")",
";",
"if",
"(",
"h",
"->",
"demangled",
"==",
"NULL",
")",
"h",
"->",
"demangled",
"=",
"h",
"->",
"root",
".",
"string",
";",
"*",
"*",
"pph",
"=",
"h",
";",
"++",
"*",
"pph",
";",
"return",
"TRUE",
";",
"}"
] | Copy the addresses of the hash table entries into an array. | [
"Copy",
"the",
"addresses",
"of",
"the",
"hash",
"table",
"entries",
"into",
"an",
"array",
"."
] | [] | [
{
"param": "h",
"type": "struct cref_hash_entry"
},
{
"param": "data",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "h",
"type": "struct cref_hash_entry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a489058904b799df8d5e0b9de34de67f4179b0cb | atrens/DragonFlyBSD-src | contrib/binutils-2.27/ld/ldcref.c | [
"BSD-3-Clause"
] | C | cref_sort_array | int | static int
cref_sort_array (const void *a1, const void *a2)
{
const struct cref_hash_entry *const *p1
= (const struct cref_hash_entry *const *) a1;
const struct cref_hash_entry *const *p2
= (const struct cref_hash_entry *const *) a2;
if (demangling)
return strcmp ((*p1)->demangled, (*p2)->demangled);
else
return strcmp ((*p1)->root.string, (*p2)->root.string);
} | /* Sort an array of cref hash table entries by name. */ | Sort an array of cref hash table entries by name. | [
"Sort",
"an",
"array",
"of",
"cref",
"hash",
"table",
"entries",
"by",
"name",
"."
] | static int
cref_sort_array (const void *a1, const void *a2)
{
const struct cref_hash_entry *const *p1
= (const struct cref_hash_entry *const *) a1;
const struct cref_hash_entry *const *p2
= (const struct cref_hash_entry *const *) a2;
if (demangling)
return strcmp ((*p1)->demangled, (*p2)->demangled);
else
return strcmp ((*p1)->root.string, (*p2)->root.string);
} | [
"static",
"int",
"cref_sort_array",
"(",
"const",
"void",
"*",
"a1",
",",
"const",
"void",
"*",
"a2",
")",
"{",
"const",
"struct",
"cref_hash_entry",
"*",
"const",
"*",
"p1",
"=",
"(",
"const",
"struct",
"cref_hash_entry",
"*",
"const",
"*",
")",
"a1",
";",
"const",
"struct",
"cref_hash_entry",
"*",
"const",
"*",
"p2",
"=",
"(",
"const",
"struct",
"cref_hash_entry",
"*",
"const",
"*",
")",
"a2",
";",
"if",
"(",
"demangling",
")",
"return",
"strcmp",
"(",
"(",
"*",
"p1",
")",
"->",
"demangled",
",",
"(",
"*",
"p2",
")",
"->",
"demangled",
")",
";",
"else",
"return",
"strcmp",
"(",
"(",
"*",
"p1",
")",
"->",
"root",
".",
"string",
",",
"(",
"*",
"p2",
")",
"->",
"root",
".",
"string",
")",
";",
"}"
] | Sort an array of cref hash table entries by name. | [
"Sort",
"an",
"array",
"of",
"cref",
"hash",
"table",
"entries",
"by",
"name",
"."
] | [] | [
{
"param": "a1",
"type": "void"
},
{
"param": "a2",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "a1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "a2",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a489058904b799df8d5e0b9de34de67f4179b0cb | atrens/DragonFlyBSD-src | contrib/binutils-2.27/ld/ldcref.c | [
"BSD-3-Clause"
] | C | output_one_cref | void | static void
output_one_cref (FILE *fp, struct cref_hash_entry *h)
{
int len;
struct bfd_link_hash_entry *hl;
struct cref_ref *r;
hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
FALSE, TRUE);
if (hl == NULL)
einfo ("%P: symbol `%T' missing from main hash table\n",
h->root.string);
else
{
/* If this symbol is defined in a dynamic object but never
referenced by a normal object, then don't print it. */
if (hl->type == bfd_link_hash_defined)
{
if (hl->u.def.section->output_section == NULL)
return;
if (hl->u.def.section->owner != NULL
&& (hl->u.def.section->owner->flags & DYNAMIC) != 0)
{
for (r = h->refs; r != NULL; r = r->next)
if ((r->abfd->flags & DYNAMIC) == 0)
break;
if (r == NULL)
return;
}
}
}
if (demangling)
{
fprintf (fp, "%s ", h->demangled);
len = strlen (h->demangled) + 1;
}
else
{
fprintf (fp, "%s ", h->root.string);
len = strlen (h->root.string) + 1;
}
for (r = h->refs; r != NULL; r = r->next)
{
if (r->def)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
for (r = h->refs; r != NULL; r = r->next)
{
if (r->common)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
for (r = h->refs; r != NULL; r = r->next)
{
if (!r->def && !r->common)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
ASSERT (len == 0);
} | /* Output one entry in the cross reference table. */ | Output one entry in the cross reference table. | [
"Output",
"one",
"entry",
"in",
"the",
"cross",
"reference",
"table",
"."
] | static void
output_one_cref (FILE *fp, struct cref_hash_entry *h)
{
int len;
struct bfd_link_hash_entry *hl;
struct cref_ref *r;
hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
FALSE, TRUE);
if (hl == NULL)
einfo ("%P: symbol `%T' missing from main hash table\n",
h->root.string);
else
{
if (hl->type == bfd_link_hash_defined)
{
if (hl->u.def.section->output_section == NULL)
return;
if (hl->u.def.section->owner != NULL
&& (hl->u.def.section->owner->flags & DYNAMIC) != 0)
{
for (r = h->refs; r != NULL; r = r->next)
if ((r->abfd->flags & DYNAMIC) == 0)
break;
if (r == NULL)
return;
}
}
}
if (demangling)
{
fprintf (fp, "%s ", h->demangled);
len = strlen (h->demangled) + 1;
}
else
{
fprintf (fp, "%s ", h->root.string);
len = strlen (h->root.string) + 1;
}
for (r = h->refs; r != NULL; r = r->next)
{
if (r->def)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
for (r = h->refs; r != NULL; r = r->next)
{
if (r->common)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
for (r = h->refs; r != NULL; r = r->next)
{
if (!r->def && !r->common)
{
while (len < FILECOL)
{
putc (' ', fp);
++len;
}
lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
ASSERT (len == 0);
} | [
"static",
"void",
"output_one_cref",
"(",
"FILE",
"*",
"fp",
",",
"struct",
"cref_hash_entry",
"*",
"h",
")",
"{",
"int",
"len",
";",
"struct",
"bfd_link_hash_entry",
"*",
"hl",
";",
"struct",
"cref_ref",
"*",
"r",
";",
"hl",
"=",
"bfd_link_hash_lookup",
"(",
"link_info",
".",
"hash",
",",
"h",
"->",
"root",
".",
"string",
",",
"FALSE",
",",
"FALSE",
",",
"TRUE",
")",
";",
"if",
"(",
"hl",
"==",
"NULL",
")",
"einfo",
"(",
"\"",
"\\n",
"\"",
",",
"h",
"->",
"root",
".",
"string",
")",
";",
"else",
"{",
"if",
"(",
"hl",
"->",
"type",
"==",
"bfd_link_hash_defined",
")",
"{",
"if",
"(",
"hl",
"->",
"u",
".",
"def",
".",
"section",
"->",
"output_section",
"==",
"NULL",
")",
"return",
";",
"if",
"(",
"hl",
"->",
"u",
".",
"def",
".",
"section",
"->",
"owner",
"!=",
"NULL",
"&&",
"(",
"hl",
"->",
"u",
".",
"def",
".",
"section",
"->",
"owner",
"->",
"flags",
"&",
"DYNAMIC",
")",
"!=",
"0",
")",
"{",
"for",
"(",
"r",
"=",
"h",
"->",
"refs",
";",
"r",
"!=",
"NULL",
";",
"r",
"=",
"r",
"->",
"next",
")",
"if",
"(",
"(",
"r",
"->",
"abfd",
"->",
"flags",
"&",
"DYNAMIC",
")",
"==",
"0",
")",
"break",
";",
"if",
"(",
"r",
"==",
"NULL",
")",
"return",
";",
"}",
"}",
"}",
"if",
"(",
"demangling",
")",
"{",
"fprintf",
"(",
"fp",
",",
"\"",
"\"",
",",
"h",
"->",
"demangled",
")",
";",
"len",
"=",
"strlen",
"(",
"h",
"->",
"demangled",
")",
"+",
"1",
";",
"}",
"else",
"{",
"fprintf",
"(",
"fp",
",",
"\"",
"\"",
",",
"h",
"->",
"root",
".",
"string",
")",
";",
"len",
"=",
"strlen",
"(",
"h",
"->",
"root",
".",
"string",
")",
"+",
"1",
";",
"}",
"for",
"(",
"r",
"=",
"h",
"->",
"refs",
";",
"r",
"!=",
"NULL",
";",
"r",
"=",
"r",
"->",
"next",
")",
"{",
"if",
"(",
"r",
"->",
"def",
")",
"{",
"while",
"(",
"len",
"<",
"FILECOL",
")",
"{",
"putc",
"(",
"'",
"'",
",",
"fp",
")",
";",
"++",
"len",
";",
"}",
"lfinfo",
"(",
"fp",
",",
"\"",
"\\n",
"\"",
",",
"r",
"->",
"abfd",
")",
";",
"len",
"=",
"0",
";",
"}",
"}",
"for",
"(",
"r",
"=",
"h",
"->",
"refs",
";",
"r",
"!=",
"NULL",
";",
"r",
"=",
"r",
"->",
"next",
")",
"{",
"if",
"(",
"r",
"->",
"common",
")",
"{",
"while",
"(",
"len",
"<",
"FILECOL",
")",
"{",
"putc",
"(",
"'",
"'",
",",
"fp",
")",
";",
"++",
"len",
";",
"}",
"lfinfo",
"(",
"fp",
",",
"\"",
"\\n",
"\"",
",",
"r",
"->",
"abfd",
")",
";",
"len",
"=",
"0",
";",
"}",
"}",
"for",
"(",
"r",
"=",
"h",
"->",
"refs",
";",
"r",
"!=",
"NULL",
";",
"r",
"=",
"r",
"->",
"next",
")",
"{",
"if",
"(",
"!",
"r",
"->",
"def",
"&&",
"!",
"r",
"->",
"common",
")",
"{",
"while",
"(",
"len",
"<",
"FILECOL",
")",
"{",
"putc",
"(",
"'",
"'",
",",
"fp",
")",
";",
"++",
"len",
";",
"}",
"lfinfo",
"(",
"fp",
",",
"\"",
"\\n",
"\"",
",",
"r",
"->",
"abfd",
")",
";",
"len",
"=",
"0",
";",
"}",
"}",
"ASSERT",
"(",
"len",
"==",
"0",
")",
";",
"}"
] | Output one entry in the cross reference table. | [
"Output",
"one",
"entry",
"in",
"the",
"cross",
"reference",
"table",
"."
] | [
"/* If this symbol is defined in a dynamic object but never\n\t referenced by a normal object, then don't print it. */"
] | [
{
"param": "fp",
"type": "FILE"
},
{
"param": "h",
"type": "struct cref_hash_entry"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fp",
"type": "FILE",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "h",
"type": "struct cref_hash_entry",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a489058904b799df8d5e0b9de34de67f4179b0cb | atrens/DragonFlyBSD-src | contrib/binutils-2.27/ld/ldcref.c | [
"BSD-3-Clause"
] | C | check_nocrossrefs | void | void
check_nocrossrefs (void)
{
if (!cref_initialized)
return;
cref_hash_traverse (&cref_table, check_nocrossref, NULL);
lang_for_each_file (check_local_sym_xref);
} | /* Check for prohibited cross references. */ | Check for prohibited cross references. | [
"Check",
"for",
"prohibited",
"cross",
"references",
"."
] | void
check_nocrossrefs (void)
{
if (!cref_initialized)
return;
cref_hash_traverse (&cref_table, check_nocrossref, NULL);
lang_for_each_file (check_local_sym_xref);
} | [
"void",
"check_nocrossrefs",
"(",
"void",
")",
"{",
"if",
"(",
"!",
"cref_initialized",
")",
"return",
";",
"cref_hash_traverse",
"(",
"&",
"cref_table",
",",
"check_nocrossref",
",",
"NULL",
")",
";",
"lang_for_each_file",
"(",
"check_local_sym_xref",
")",
";",
"}"
] | Check for prohibited cross references. | [
"Check",
"for",
"prohibited",
"cross",
"references",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
Subsets and Splits