This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Correct way to access predecessors of a gimple statement?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]