fix
[libfirm] / ir / st / exc.c
index df13b7b..e253345 100644 (file)
@@ -1,22 +1,41 @@
-/* Copyright (c) 2002 by Universität Karlsruhe (TH).  All Rights Reserved */
 /*
-** Time-stamp: <Friday, 05.07.2002, 11:09:07 goetz@i44pc2.info.uni-karlsruhe.de>
-*/
-
-/***
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief     Helper functions for jack exceptions.
+ * @author    Florian Liekweg
+ * @date      4.3.2002
+ * @version   $Id$
+ */
+
+/**
    NAME
      exc
    PURPOSE
      Helper functions for exceptions
-   NOTES
+   S
      not quite complete
-   HISTORY
-     liekweg - Mar 4, 2002: Created.
-   CVS:
-     $Id$
 ***/
 
-# include "exc.h"
+#include <assert.h>
+#include "exc.h"
 
 static char* exc_strings [] = {
   "Invalid",                                   /* invalid */
@@ -101,6 +120,39 @@ static bool is_cfg_jmp (ir_node *node)
 }
 #endif
 
+void set_Block_exc(ir_node *n, exc_t exc) {
+}
+
+exc_t get_Block_exc(ir_node *n) {
+  return 0;
+}
+
+
+/* handler handling for Blocks */
+void
+set_Block_handler (ir_node *block, ir_node *handler)  {
+  assert (is_Block(block));
+  assert (is_Block(handler));
+}
+
+ir_node *
+get_Block_handler (ir_node *block) {
+  assert (is_Block(block));
+  return (NULL);
+}
+
+/* handler handling for Nodes */
+void
+set_Node_handler (ir_node *node, ir_node *handler) {
+
+}
+
+ir_node *
+get_Node_handler (ir_node *node) {
+  return (NULL);
+}
+
+
 /*
  Return true iff a new exception region must be left upon entry of this block.
 
@@ -115,7 +167,7 @@ bool is_handler_entry (ir_graph *graph, ir_node *block)
 
   if (exc_invalid == get_Block_exc (block))
        {
-         for (i = 0; (i < n) && is_entry; i ++)
+         for (i = 0; (i < n) && (is_entry == true); i ++)
                if (is_exc_jmp (get_irn_n (block, i)))
                  continue;
                else
@@ -145,7 +197,7 @@ bool is_region_entry  (ir_graph *graph, ir_node *block)
 
          bool no_handler = true;
 
-         for (i = 0; (i < n) && no_handler; i ++)
+         for (i = 0; (i < n) && (no_handler == true); i ++)
                {
                  succ = get_irn_out (block, i);
 
@@ -159,7 +211,7 @@ bool is_region_entry  (ir_graph *graph, ir_node *block)
 
   return (exc_region == get_Block_exc (block));
 
-  return (TRUE);
+  return (true);
 }
 
 /*
@@ -181,7 +233,7 @@ bool is_handler_block (ir_graph *graph, ir_node *block)
          int n_blocks    = env->dt->n_blocks;
          int i           = 0;
 
-         for (i = 0; (i < n_blocks) && no_handler; i ++)
+         for (i = 0; (i < n_blocks) && (no_handler == true); i ++)
                if (0 != (env->dt->masks [i] & block_mask)) /* if dominator */
                  if (is_handler_entry (graph, env->dt->blocks [i])) /* is handler entry */
                        no_handler = false;