<commit_before>/* Copyright (c) 2002 by Universitt Karlsruhe (TH).  All Rights Reserved */
//
// Time-stamp: <Monday, 13.05.2002, 15:51:30 <EMAIL>>
//

/***
   NAME
     exc
   PURPOSE
     Helper functions for exceptions
   NOTES
     not quite complete
   HISTORY
     liekweg - Mar 4, 2002: Created.
   CVS:
     $Id$
***/

# include "exc.h"

static char* exc_strings [] = {
  "Invalid",					/* invalid */
  "Normal",						/* normal */
  "Entry",						/* entry to region */
  "Exit",						/* exit of region */
  "Handler",					/* entry to handler */
  "Cont"
};


/*
  Return true iff (block b is a handler entry AND a dominates b) OR
  (b has a CFG successor that is both a handler entry AND is dominated
  by a)
*/
static bool has_handler (ir_graph *graph, ir_node *b, ir_node *a)
{
  int i         = 0;
  int n         = get_irn_n_outs (b);
  ir_node *succ = 0;

  assert (0 && "Wrongly implemented");
  // must check for _immediate_ dominance !!!

  if (is_handler_entry (graph, b) && dominates (graph, a, b))
	return (true);

  for (i = 0; i < n; i ++)
	{
	  succ = get_irn_out (b, i);

	  if (has_handler (graph, succ, a))
		return (true);
	}

  return (false);
}

/*
  Return true iff the given node represents an exception jump
*/
static bool is_exc_jmp (ir_node *node)
{
  ir_op *op = get_irn_op (node);

  // Proj_X (Load), Proj_X (Sto), Proj_X (Div_Int),
  // Proj_X (Raise), Proj_X (Call), Proj_X (Alloc)
  if (op == op_Proj)
	{
	  op = get_irn_op (get_Proj_pred (node));

	  assert ((is_fragile_op(get_Proj_pred))       &&
		  (op != op_Bad) && (op != op_Unknown) &&
		  (get_irn_mode(node) == mode_X));// Check for proper Proj attr
	  return (true);
	}
  else
	{
	  return (false);
	}
}

/*
Return true iff the given node represents a normal cfg jump
*/
static bool is_cfg_jmp (ir_node *node)
{<commit_msg>Grrrr...<commit_after>/* Copyright (c) 2002 by Universitt Karlsruhe (TH).  All Rights Reserved */
//
// Time-stamp: <Monday, 13.05.2002, 15:53:33 <EMAIL>>
//

/***
   NAME
     exc
   PURPOSE
     Helper functions for exceptions
   NOTES
     not quite complete
   HISTORY
     liekweg - Mar 4, 2002: Created.
   CVS:
     $Id$
***/

# include "exc.h"

static char* exc_strings [] = {
  "Invalid",					/* invalid */
  "Normal",						/* normal */
  "Entry",						/* entry to region */
  "Exit",						/* exit of region */
  "Handler",					/* entry to handler */
  "Cont"
};


/*
  Return true iff (block b is a handler entry AND a dominates b) OR
  (b has a CFG successor that is both a handler entry AND is dominated
  by a)
*/
static bool has_handler (ir_graph *graph, ir_node *b, ir_node *a)
{
  int i         = 0;
  int n         = get_irn_n_outs (b);
  ir_node *succ = 0;

  assert (0 && "Wrongly implemented");
  // must check for _immediate_ dominance !!!

  if (is_handler_entry (graph, b) && dominates (graph, a, b))
	return (true);

  for (i = 0; i < n; i ++)
	{
	  succ = get_irn_out (b, i);

	  if (has_handler (graph, succ, a))
		return (true);
	}

  return (false);
}

/*
  Return true iff the given node represents an exception jump
*/
static bool is_exc_jmp (ir_node *node)
{
  ir_op *op = get_irn_op (node);

  // Proj_X (Load), Proj_X (Sto), Proj_X (Div_Int),
  // Proj_X (Raise), Proj_X (Call), Proj_X (Alloc)
  if (op == op_Proj)
	{
	  op = get_irn_op (get_Proj_pred (node));

	  assert ((is_fragile_op(get_Proj_pred(node))) &&
		  (op != op_Bad) && (op != op_Unknown) &&
		  (get_irn_mode(node) == mode_X));// Check for proper Proj attr
	  return (true);
	}
  else
	{
	  return (false);
	}
}

/*
Return true iff the given node represents a normal cfg jump
*/
static bool is_cfg_jmp (ir_node *node)
{
{'fraction_non_alphanumeric': 0.14638835484756935, 'fraction_numerical': 0.014831090359791266, 'mean_word_length': 2.6639839034205233, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5057565', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1378, 'n_words': 432}