This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Correct way to access predecessors of a gimple statement?
- From: Kartik Singhal <kartiksinghal at gmail dot com>
- To: Sudakshina Das <sudakshina1990 at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 5 May 2013 12:52:32 +0530
- Subject: Re: Correct way to access predecessors of a gimple statement?
- References: <CAAY3Td6SRR0AoU1xcCzvxq6LYjYp6eL2_0TGODmrh7skKA=xxw at mail dot gmail dot com> <CAAg-WFeFj1901Bo-ZxUUU52pAHfvUhG4abu2o2Kp0oT3f+1kBw at mail dot gmail dot com>
On Sun, May 5, 2013 at 12:39 PM, Sudakshina Das
<sudakshina1990@gmail.com> wrote:
> You can use the iterator FOR_EACH_EDGE in this form:
>
> FOR_EACH_EDGE (e, ei, bb->preds)
>
> where e is an edge ei is edge iterator bb is a basic block.
Oh, I guess this is exactly what I need. Now, I looked it up,
basic_block.h has such an example but deep down at ~890th line, no
wonder I managed to miss it impatiently.
And after obtaining the pred edges, I can get the src block, and
through that any of the contained gimple stmt. Looks like problem
solved, thanks a lot.
--
Kartik
http://k4rtik.wordpress.com/