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]

Difference between 'FOR_EACH_BB' and 'for (i=0; i<n_basic_blocks; i++){}'


My understanding is that: both are used to traverse BBs and the only (potential )difference is the order of the traversal. 'FOR_EACH_BB' traverses BBs throught the linked list order; 'for (i=0; i<n_basic_blocks; i++){bb=BASIC_BLOCK(i);}' traverses accoring to the BB's index (because BASIC_BLOCK(i)->index ==i)

(Please correct me if my understanding is wrong:) )

So, is there any particular reason to pick up on over the other? For example, function 'compute_defs_uses_and_gen()' in bt-load.c uses the latter one to traverse basic blocks, but most other routines use the first one to traverse BBs.

Thanks,

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



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