diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-19 00:26:56 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-19 00:26:56 +0000 |
commit | 060ce5837e98223885e15de0e0f8ec49863c840f (patch) | |
tree | b36c1adf97283d550b96e06e464780e67b445c90 /gcc/cfgrtl.c | |
parent | 975f43b4a8a6dddfdc6ee5747e9da77ab17bb099 (diff) | |
download | gcc-060ce5837e98223885e15de0e0f8ec49863c840f.tar.gz |
Replace BB_HEAD et al macros with functions
gcc/
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (BB_HEAD): Convert to a function. Strengthen the
return type from rtx to rtx_insn *.
(BB_END): Likewise.
(BB_HEADER): Likewise.
(BB_FOOTER): Likewise.
(SET_BB_HEAD): Convert to a function.
(SET_BB_END): Likewise.
(SET_BB_HEADER): Likewise.
(SET_BB_FOOTER): Likewise.
* cfgrtl.c (BB_HEAD): New function, from macro of same name.
Strengthen the return type from rtx to rtx_insn *. For now, this
is done by adding a checked cast, but this will eventually
become a field lookup.
(BB_END): Likewise.
(BB_HEADER): Likewise.
(BB_FOOTER): Likewise.
(SET_BB_HEAD): New function, from macro of same name. This is
intended for use as an lvalue, and so returns an rtx& to allow
in-place modification.
(SET_BB_END): Likewise.
(SET_BB_HEADER): Likewise.
(SET_BB_FOOTER): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214126 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 65437625eae..671d5f32767 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -5091,4 +5091,64 @@ struct cfg_hooks cfg_layout_rtl_cfg_hooks = { rtl_account_profile_record, }; +/* BB_HEAD as an rvalue. */ + +rtx_insn *BB_HEAD (const_basic_block bb) +{ + rtx insn = bb->il.x.head_; + return safe_as_a <rtx_insn *> (insn); +} + +/* BB_HEAD for use as an lvalue. */ + +rtx& SET_BB_HEAD (basic_block bb) +{ + return bb->il.x.head_; +} + +/* BB_END as an rvalue. */ + +rtx_insn *BB_END (const_basic_block bb) +{ + rtx insn = bb->il.x.rtl->end_; + return safe_as_a <rtx_insn *> (insn); +} + +/* BB_END as an lvalue. */ + +rtx& SET_BB_END (basic_block bb) +{ + return bb->il.x.rtl->end_; +} + +/* BB_HEADER as an rvalue. */ + +rtx_insn *BB_HEADER (const_basic_block bb) +{ + rtx insn = bb->il.x.rtl->header_; + return safe_as_a <rtx_insn *> (insn); +} + +/* BB_HEADER as an lvalue. */ + +rtx& SET_BB_HEADER (basic_block bb) +{ + return bb->il.x.rtl->header_; +} + +/* BB_FOOTER as an rvalue. */ + +rtx_insn *BB_FOOTER (const_basic_block bb) +{ + rtx insn = bb->il.x.rtl->footer_; + return safe_as_a <rtx_insn *> (insn); +} + +/* BB_FOOTER as an lvalue. */ + +rtx& SET_BB_FOOTER (basic_block bb) +{ + return bb->il.x.rtl->footer_; +} + #include "gt-cfgrtl.h" |