public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/pheeck/heads/sccp)] tarjan_sccs vector is now vec<vec> insted of vec<vec *>
@ 2023-02-15 10:13 Filip Kastl
0 siblings, 0 replies; 2+ messages in thread
From: Filip Kastl @ 2023-02-15 10:13 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:33129e1d8e48dbe8eed7545baab9666926b129b2
commit 33129e1d8e48dbe8eed7545baab9666926b129b2
Author: Filip Kastl <filip.kastl@gmail.com>
Date: Sun Jul 17 10:40:22 2022 +0200
tarjan_sccs vector is now vec<vec> insted of vec<vec *>
Diff:
---
gcc/sccp.cc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index ea4a5d2fc84..0310cce3ca2 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -70,7 +70,7 @@ struct vertex
/* Each SSA name corresponds to a vertex. Indexed by SSA version number. */
static *vertices;
/* Each SCC is a vector of version nums. */
-static vec<vec<unsigned>*> tarjan_sccs; // TODO Correct * style?
+static vec<vec<unsigned>> tarjan_sccs;
static vec<unsigned> tarjan_stack;
static unsigned tarjan_index = 0;
@@ -85,9 +85,9 @@ init_sccp (void)
/* Free structures used for sccp. */
static void
-finalize_sscp (void)
+finalize_sccp (void)
{
- // TODO
+ XDELETEVEC (vertices);
}
/* TODO */
@@ -149,14 +149,14 @@ tarjan_strongconnect (gphi *phi)
if (vertices[vnum].lowlink == vertices[vnum].index)
{
- vec<unsigned> *new_scc = new vec<unsigned>();
+ vec<unsigned> new_scc = vNULL;
unsigned stack_vnum;
do /* There will always be at least 1 vertex on stack. */
{
stack_vnum = tarjan_stack.pop ();
vertices[stack_vnum].is_on_stack = false;
- new_scc->safe_push (stack_vnum);
+ new_scc.safe_push (stack_vnum);
}
while (stack_vnum != vnum);
@@ -243,16 +243,16 @@ pass_sccp::execute (function *)
tarjan_compute_sccs ();
std::cerr << "ahoj" << std::endl;
- for (vec<unsigned> *scc : tarjan_sccs)
+ for (vec<unsigned> scc : tarjan_sccs)
{
- for (unsigned phi : *scc)
+ for (unsigned phi : scc)
{
std::cerr << phi << std::endl;
}
std::cerr << std::endl;
}
- finalize_sscp ();
+ finalize_sccp ();
return 0; // TODO What should I return?
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/pheeck/heads/sccp)] tarjan_sccs vector is now vec<vec> insted of vec<vec *>
@ 2022-07-17 8:40 Filip Kastl
0 siblings, 0 replies; 2+ messages in thread
From: Filip Kastl @ 2022-07-17 8:40 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:25ca4c0949b22b70a8b135afe03a2723c61d8a6f
commit 25ca4c0949b22b70a8b135afe03a2723c61d8a6f
Author: Filip Kastl <filip.kastl@gmail.com>
Date: Sun Jul 17 10:40:22 2022 +0200
tarjan_sccs vector is now vec<vec> insted of vec<vec *>
Diff:
---
gcc/sccp.cc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index ea4a5d2fc84..0310cce3ca2 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -70,7 +70,7 @@ struct vertex
/* Each SSA name corresponds to a vertex. Indexed by SSA version number. */
static *vertices;
/* Each SCC is a vector of version nums. */
-static vec<vec<unsigned>*> tarjan_sccs; // TODO Correct * style?
+static vec<vec<unsigned>> tarjan_sccs;
static vec<unsigned> tarjan_stack;
static unsigned tarjan_index = 0;
@@ -85,9 +85,9 @@ init_sccp (void)
/* Free structures used for sccp. */
static void
-finalize_sscp (void)
+finalize_sccp (void)
{
- // TODO
+ XDELETEVEC (vertices);
}
/* TODO */
@@ -149,14 +149,14 @@ tarjan_strongconnect (gphi *phi)
if (vertices[vnum].lowlink == vertices[vnum].index)
{
- vec<unsigned> *new_scc = new vec<unsigned>();
+ vec<unsigned> new_scc = vNULL;
unsigned stack_vnum;
do /* There will always be at least 1 vertex on stack. */
{
stack_vnum = tarjan_stack.pop ();
vertices[stack_vnum].is_on_stack = false;
- new_scc->safe_push (stack_vnum);
+ new_scc.safe_push (stack_vnum);
}
while (stack_vnum != vnum);
@@ -243,16 +243,16 @@ pass_sccp::execute (function *)
tarjan_compute_sccs ();
std::cerr << "ahoj" << std::endl;
- for (vec<unsigned> *scc : tarjan_sccs)
+ for (vec<unsigned> scc : tarjan_sccs)
{
- for (unsigned phi : *scc)
+ for (unsigned phi : scc)
{
std::cerr << phi << std::endl;
}
std::cerr << std::endl;
}
- finalize_sscp ();
+ finalize_sccp ();
return 0; // TODO What should I return?
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-15 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 10:13 [gcc(refs/users/pheeck/heads/sccp)] tarjan_sccs vector is now vec<vec> insted of vec<vec *> Filip Kastl
-- strict thread matches above, loose matches on Subject: below --
2022-07-17 8:40 Filip Kastl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).