remove the unused/strange concept of a pseudo-irg
authorMatthias Braun <matze@braunis.de>
Thu, 15 Jul 2010 09:06:14 +0000 (09:06 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 15 Jul 2010 09:06:14 +0000 (09:06 +0000)
[r27740]

22 files changed:
include/libfirm/Makefile.am
include/libfirm/firm.h
include/libfirm/iroptimize.h
include/libfirm/irprog.h
include/libfirm/pseudo_irg.h [deleted file]
ir/Makefile.am
ir/ana/rta.c
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/amd64/bearch_amd64.c
ir/be/arm/bearch_arm.c
ir/be/bemain.c
ir/be/ia32/bearch_ia32.c
ir/be/sparc/bearch_sparc.c
ir/common/firm.c
ir/ir/irgraph_t.h
ir/ir/irprog.c
ir/ir/irprog_t.h
ir/ir/irtypes.h
ir/ir/pseudo_irg.c [deleted file]
ir/tr/entity_t.h
win32/vc2010/firm.vcxproj
win32/vc2010/firm.vcxproj.filters

index 2abdb06..9aaf454 100644 (file)
@@ -51,7 +51,6 @@ libfirminclude_HEADERS = \
        irtypeinfo.h \
        irvrfy.h \
        lowering.h \
-       pseudo_irg.h \
        rta.h \
        seqnumbers.h \
        structure.h \
index 8a1ddad..f3ed233 100644 (file)
 #include "irtypeinfo.h"
 #include "irvrfy.h"
 #include "lowering.h"
-#include "pseudo_irg.h"
 #include "rta.h"
 #include "seqnumbers.h"
 #include "structure.h"
index 2d3bcba..907f3f2 100644 (file)
@@ -178,7 +178,7 @@ FIRM_API void escape_analysis(int run_scalar_replace,
  * This is a rather strong criteria, so do not expect that a
  * lot of functions will be found. Moreover, all of them might
  * already be inlined if inlining is activated.
- * Anyway, it might be good for handling builtin's or pseudo-graphs,
+ * Anyway, it might be good for handling builtin's
  * even if the later read/write memory (but we know how).
  *
  * This optimizations read the irg_const_function property of
index 926f44d..b34d735 100644 (file)
@@ -151,13 +151,6 @@ FIRM_API ir_graph *get_irp_irg(int pos);
 /** Sets the ir graph at position pos. */
 FIRM_API void set_irp_irg(int pos, ir_graph *irg);
 
-/** Gets the number of graphs _and_ pseudo graphs. */
-FIRM_API int get_irp_n_allirgs(void);
-
-/** Returns the ir graph at position pos of all graphs (including
- pseudo graphs).  Visits first graphs, then pseudo graphs. */
-FIRM_API ir_graph *get_irp_allirg(int pos);
-
 /**
  * Returns the type containing the entities for a segment.
  *
diff --git a/include/libfirm/pseudo_irg.h b/include/libfirm/pseudo_irg.h
deleted file mode 100644 (file)
index 9593d2d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 1995-2008 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    interface to pseudo irgs
- * @author   Goetz Lindenmaier, Boris Boesler
- * @date     Oktober 2004
- * @version  $Id$
- */
-#ifndef FIRM_IR_PSEUDO_IRG_H
-#define FIRM_IR_PSEUDO_IRG_H
-
-#include "firm_types.h"
-
-#include "begin.h"
-
-/** Create a new ir graph to build a pseudo representation of a procedure.
- *
- *  The pseudo representation can only be used for analyses.  It may not be
- *  optimized.  Pseudo graphs are kept in a separate graph list in irprog.
- */
-FIRM_API ir_graph *new_pseudo_ir_graph(ir_entity *ent, int n_loc);
-
-/** Returns non-zero ir ir_graph is pseudo graph.
- *  Is irg a pseudo graph for analysis? */
-FIRM_API int is_pseudo_ir_graph(ir_graph *irg);
-
-/** Returns the number of pseudo graphs in the program. */
-FIRM_API int get_irp_n_pseudo_irgs(void);
-
-/** Add a graph as pseudo irg */
-FIRM_API void add_irp_pseudo_irg(ir_graph *irg);
-
-/** Returns the pos'th  pseudo graph in the program. */
-FIRM_API ir_graph *get_irp_pseudo_irg(int pos);
-
-/** If set, get_irp_n_irgs() and get_irp_irg() behave as if all pseudo
-    graphs are in the irg list. If not set, get_entity_irg() returns
-    NULL if the entity refers to a pseudo irg. */
-FIRM_API void set_visit_pseudo_irgs(int x);
-FIRM_API int  get_visit_pseudo_irgs(void);
-
-#include "end.h"
-
-#endif
index ab497ad..35fbc9f 100644 (file)
@@ -177,7 +177,6 @@ libfirm_la_SOURCES = \
        ir/irprog.c \
        ir/irssacons.c \
        ir/irvrfy.c \
-       ir/pseudo_irg.c \
        ir/valueset.c \
        libcore/lc_appendable.c \
        libcore/lc_config_lexer.c \
index 4d282f0..0c935d0 100644 (file)
@@ -315,8 +315,6 @@ static void init_tables(void)
 void rta_init(void)
 {
        int n_runs = 0;
-       int rem_vpi = get_visit_pseudo_irgs();
-       set_visit_pseudo_irgs(1);
 
        FIRM_DBG_REGISTER(dbg, "firm.ana.rta");
 
@@ -348,8 +346,6 @@ void rta_init(void)
                tr_vrfy();
        }
 # endif /* defined DEBUG_libfirm */
-
-       set_visit_pseudo_irgs(rem_vpi);
 }
 
 /**
@@ -383,9 +379,6 @@ void rta_delete_dead_graphs(void)
        int      i, n_dead_irgs, n_graphs = get_irp_n_irgs();
        ir_graph *irg, *next_irg, *dead_irgs;
 
-       int rem_vpi = get_visit_pseudo_irgs();
-       set_visit_pseudo_irgs(1);
-
        irp_reserve_resources(irp, IR_RESOURCE_IRG_LINK);
 
        n_dead_irgs = 0;
@@ -410,7 +403,6 @@ void rta_delete_dead_graphs(void)
        DB((dbg, LEVEL_1, "RTA: dead methods = %i\n", n_dead_irgs));
 
        irp_free_resources(irp, IR_RESOURCE_IRG_LINK);
-       set_visit_pseudo_irgs(rem_vpi);
 }
 
 /* Clean up the RTA data structures.  Call this after calling rta_init */
index aeb2ba6..34d200a 100644 (file)
@@ -24,7 +24,6 @@
  */
 #include "config.h"
 
-#include "pseudo_irg.h"
 #include "irgwalk.h"
 #include "irprog.h"
 #include "irprintf.h"
index 8219222..974a145 100644 (file)
@@ -24,7 +24,6 @@
  */
 #include "config.h"
 
-#include "pseudo_irg.h"
 #include "irgwalk.h"
 #include "irprog.h"
 #include "irprintf.h"
index 3ed7ce5..f58b90e 100644 (file)
@@ -28,7 +28,6 @@
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
 
-#include "pseudo_irg.h"
 #include "irgwalk.h"
 #include "irprog.h"
 #include "irprintf.h"
index 1ea9094..7308834 100644 (file)
@@ -895,9 +895,6 @@ void be_main(FILE *file_handle, const char *cup_name)
        }
 #endif
 
-       /* never build code for pseudo irgs */
-       set_visit_pseudo_irgs(0);
-
        be_main_loop(file_handle, cup_name);
 
        if (be_options.timing == BE_TIME_ON) {
index a5234d7..401c2cf 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <math.h>
 
-#include "pseudo_irg.h"
 #include "irarch.h"
 #include "irgwalk.h"
 #include "irprog.h"
index a1b0790..3f81ba4 100644 (file)
@@ -28,7 +28,6 @@
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
 
-#include "pseudo_irg.h"
 #include "irgwalk.h"
 #include "irprog.h"
 #include "irprintf.h"
index e62952a..5e08ff4 100644 (file)
@@ -154,8 +154,6 @@ void ir_finish(void)
 
        for (i = get_irp_n_irgs() - 1; i >= 0; --i)
                free_ir_graph(get_irp_irg(i));
-       for (i = get_irp_n_pseudo_irgs() - 1; i >= 0; --i)
-               free_ir_graph(get_irp_pseudo_irg(i));
 
        free_type_entities(get_glob_type());
        for (i = get_irp_n_types() - 1; i >= 0; --i)
index 6640ef2..153ce82 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "irtypes.h"
 #include "irprog.h"
-#include "pseudo_irg.h"
 #include "type_t.h"
 #include "entity_t.h"
 #include "iredgekinds.h"
index 47e0631..f379ff2 100644 (file)
@@ -31,7 +31,6 @@
 #include "irprog_t.h"
 #include "irgraph_t.h"
 #include "irpass_t.h"
-#include "pseudo_irg.h"
 #include "array.h"
 #include "error.h"
 #include "obst.h"
@@ -58,7 +57,6 @@ static ir_prog *new_incomplete_ir_prog(void)
 
        res->kind           = k_ir_prog;
        res->graphs         = NEW_ARR_F(ir_graph *, 0);
-       res->pseudo_graphs  = NEW_ARR_F(ir_graph *, 0);
        res->types          = NEW_ARR_F(ir_type *, 0);
        res->modes          = NEW_ARR_F(ir_mode *, 0);
        res->opcodes        = NEW_ARR_F(ir_op *, 0);
@@ -152,7 +150,6 @@ void free_ir_prog(void)
 
        free_ir_graph(irp->const_code_irg);
        DEL_ARR_F(irp->graphs);
-       DEL_ARR_F(irp->pseudo_graphs);
        DEL_ARR_F(irp->types);
        DEL_ARR_F(irp->modes);
 
@@ -229,18 +226,6 @@ void remove_irp_irg_from_list(ir_graph *irg)
                        break;
                }
        }
-       if (!found) {
-               l = ARR_LEN(irp->pseudo_graphs);
-               for (i = 0; i < l; i++) {
-                       if (irp->pseudo_graphs[i] == irg) {
-                               for (; i < l - 1; i++) {
-                                       irp->pseudo_graphs[i] = irp->pseudo_graphs[i+1];
-                               }
-                               ARR_SETLEN(ir_graph*, irp->pseudo_graphs, l - 1);
-                               break;
-                       }
-               }
-       }
 }
 
 /* Removes irg from the list or irgs, shrinks the list by one. */
@@ -272,26 +257,6 @@ void set_irp_irg(int pos, ir_graph *irg)
        irp->graphs[pos] = irg;
 }
 
-/* Gets the number of graphs _and_ pseudo graphs. */
-int get_irp_n_allirgs(void)
-{
-       /* We can not call get_irp_n_irgs, as we end up in a recursion ... */
-       return ARR_LEN(irp->graphs) + get_irp_n_pseudo_irgs();
-}
-
-/* Returns the ir graph at position pos of all graphs (including
- pseudo graphs).  Visits first graphs, then pseudo graphs. */
-ir_graph *get_irp_allirg(int pos)
-{
-       int n_irgs = ARR_LEN(irp->graphs);
-       assert(0 <= pos);
-       if (pos < n_irgs) {
-               return irp->graphs[pos];
-       } else {
-               return get_irp_pseudo_irg(pos-n_irgs);
-       }
-}
-
 /* Adds type to the list of types in irp. */
 void add_irp_type(ir_type *typ)
 {
index f4152ec..6673c08 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "irprog.h"
 #include "irtypes.h"
-#include "pseudo_irg.h"
 #include "ircgcons.h"
 #include "irtypeinfo.h"
 #include "irmemory.h"
@@ -63,18 +62,15 @@ static inline ir_type *_get_tls_type(void)
 static inline int _get_irp_n_irgs(void)
 {
        assert(irp && irp->graphs);
-       if (get_visit_pseudo_irgs()) return get_irp_n_allirgs();
        return ARR_LEN(irp->graphs);
 }
 
 static inline ir_graph *_get_irp_irg(int pos)
 {
-       if (get_visit_pseudo_irgs()) return get_irp_allirg(pos);
        assert(0 <= pos && pos <= ARR_LEN(irp->graphs));
        return irp->graphs[pos];
 }
 
-
 static inline int _get_irp_n_types(void)
 {
        assert(irp && irp->types);
index 8171fff..0df6d12 100644 (file)
@@ -553,7 +553,6 @@ struct ir_prog {
        ir_graph  *main_irg;            /**< The entry point to the compiled program
                                             or NULL if no point exists. */
        ir_graph **graphs;              /**< A list of all graphs in the ir. */
-       ir_graph **pseudo_graphs;       /**< A list of all pseudo graphs in the ir. See pseudo_irg.c */
        ir_graph  *const_code_irg;      /**< This ir graph gives the proper environment
                                             to allocate nodes the represent values
                                             of constant entities. It is not meant as
diff --git a/ir/ir/pseudo_irg.c b/ir/ir/pseudo_irg.c
deleted file mode 100644 (file)
index a824fb2..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 1995-2008 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    pseudo irg implementation
- * @author   Goetz Lindenmaier, Boris Boesler
- * @date     Oktober 2004
- * @version  $Id$
- */
-#include "config.h"
-
-
-#include "pseudo_irg.h"
-
-#include "irgraph_t.h"
-#include "irprog_t.h"
-#include "array.h"
-
-
-/* Returns the number of pseudo graphs in the program. */
-int get_irp_n_pseudo_irgs(void)
-{
-       assert (irp && irp->pseudo_graphs);
-       return ARR_LEN(irp->pseudo_graphs);
-}
-
-/* Returns the pos'th  pseudo graph in the program. */
-ir_graph *get_irp_pseudo_irg(int pos)
-{
-       assert(0 <= pos && pos <= get_irp_n_pseudo_irgs());
-       return irp->pseudo_graphs[pos];
-}
-
-void add_irp_pseudo_irg(ir_graph *irg)
-{
-       assert (irp && irp->pseudo_graphs);
-       ARR_APP1(ir_graph *, irp->pseudo_graphs, irg);
-}
-
-
-/* Create a new ir graph to build a pseudo representation of a procedure.
- *
- *  The pseudo representation can only be used for analyses.  It may not be
- *  optimized.  Pseudo graphs are kept in a separate graph list in irprog.
- */
-ir_graph *new_pseudo_ir_graph(ir_entity *ent, int n_loc)
-{
-       ir_graph *res = new_r_ir_graph(ent, n_loc);
-       add_irp_pseudo_irg(res);          /* remember this graph global. */
-       return res;
-}
-
-/* Returns non-zero ir ir_graph is pseudo graph. */
-int is_pseudo_ir_graph(ir_graph *irg)
-{
-       int i, n_pseudo_irgs;
-
-       assert(irg && "nothing here");
-       assert(is_ir_graph(irg) && "no ir_graph given");
-
-       n_pseudo_irgs = get_irp_n_pseudo_irgs();
-       for (i = 0; i < n_pseudo_irgs; ++i) {
-               if (irg == get_irp_pseudo_irg(i))
-                       return 1;
-       }
-       return 0;
-}
-
-static int visit_pseudo_irgs = 0;
-
-void set_visit_pseudo_irgs(int x)
-{
-       visit_pseudo_irgs = x;
-}
-
-int get_visit_pseudo_irgs(void)
-{
-       return visit_pseudo_irgs;
-}
index 62f604f..5b3f3a8 100644 (file)
@@ -31,7 +31,6 @@
 #include "typerep.h"
 #include "type_t.h"
 #include "ident.h"
-#include "pseudo_irg.h"
 #include "compound_path.h"
 
 typedef struct ir_initializer_base_t {
@@ -345,10 +344,7 @@ static inline ir_graph *_get_entity_irg(const ir_entity *ent)
                return NULL;
        }
 
-       irg = ent->attr.mtd_attr.irg;
-       if (irg != NULL && !get_visit_pseudo_irgs()     && is_pseudo_ir_graph(irg))
-               return NULL;
-       return irg;
+       return ent->attr.mtd_attr.irg;
 }
 
 static inline ir_visited_t _get_entity_visited(const ir_entity *ent)
index a55e196..edd0339 100644 (file)
     <ClCompile Include="$(FirmRoot)\ir\ir\irprog.c" />\r
     <ClCompile Include="$(FirmRoot)\ir\ir\irssacons.c" />\r
     <ClCompile Include="$(FirmRoot)\ir\ir\irvrfy.c" />\r
-    <ClCompile Include="$(FirmRoot)\ir\ir\pseudo_irg.c" />\r
     <ClCompile Include="$(FirmRoot)\ir\ir\valueset.c" />\r
     <ClInclude Include="$(FirmRoot)\ir\ir\gen_irnode.h" />\r
     <ClInclude Include="$(FirmRoot)\ir\ir\instrument.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\irtypeinfo.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\irvrfy.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\lowering.h" />\r
-    <ClInclude Include="$(FirmRoot)\include\libfirm\pseudo_irg.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\rta.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\seqnumbers.h" />\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\structure.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index b6b1779..159e2c2 100644 (file)
     <ClCompile Include="$(FirmRoot)\ir\ir\irvrfy.c">\r
       <Filter>ir\ir</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="$(FirmRoot)\ir\ir\pseudo_irg.c">\r
-      <Filter>ir\ir</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="$(FirmRoot)\ir\ir\valueset.c">\r
       <Filter>ir\ir</Filter>\r
     </ClCompile>\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\lowering.h">\r
       <Filter>include\libfirm</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="$(FirmRoot)\include\libfirm\pseudo_irg.h">\r
-      <Filter>include\libfirm</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="$(FirmRoot)\include\libfirm\rta.h">\r
       <Filter>include\libfirm</Filter>\r
     </ClInclude>\r
       <Filter>win32</Filter>\r
     </ResourceCompile>\r
   </ItemGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r