diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-09 14:59:49 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-09 14:59:49 +0000 |
commit | 214ed29c069b822e7421d4e81061fdbcfaa2dcb2 (patch) | |
tree | 8c76c150e9f39fa9475275c99247a8e8042e0b7f /gcc/tree-phinodes.c | |
parent | dea33130e975b929caca3f1d5a07f2e209bec2a7 (diff) | |
download | gcc-214ed29c069b822e7421d4e81061fdbcfaa2dcb2.tar.gz |
* tree-phinodes.c (phi_reverse): New.
* tree-cfg.c (tree_make_forwarder_block, tree_duplicate_bb):
Use it.
* tree-flow.h: Add a prototype for phi_reverse.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r-- | gcc/tree-phinodes.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c index 0d621b53339..a38a57273be 100644 --- a/gcc/tree-phinodes.c +++ b/gcc/tree-phinodes.c @@ -491,6 +491,21 @@ remove_all_phi_nodes_for (bitmap vars) } } +/* Reverse the order of PHI nodes in the chain PHI. + Return the new head of the chain (old last PHI node). */ + +tree +phi_reverse (tree phi) +{ + tree prev = NULL_TREE, next; + for (; phi; phi = next) + { + next = PHI_CHAIN (phi); + PHI_CHAIN (phi) = prev; + prev = phi; + } + return prev; +} #include "gt-tree-phinodes.h" |