<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Good point. But the code I'm parsing never have goto statements.</div><div><br></div><div>I'm not actually trying to perform an exhaustive search through the CFG, I'm just starting at some block and walking up through the predecessors until I hit the ENTRY block. With the depth-first iterator, it seems to me that I should first assign special numbers to each block that follows the depth-first order and then have the walker walk up the CFG and avoid predecessors whose depth-first number is less than the current block's depth-first number (seems a bit inefficient, unless I can reassign block ids which I'm guessing is not safe?). Do you have any suggestions for alternatives?</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>><br><span style="font-weight:bold">Date: </span> Wednesday, August 7, 2013 9:42 AM<br><span style="font-weight:bold">To: </span> Sung-Yee Guo <<a href="mailto:masoug@gmail.com">masoug@gmail.com</a>><br><span style="font-weight:bold">Cc: </span> <<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>>, Developers <<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>><br><span style="font-weight:bold">Subject: </span> Re: [cfe-dev] Clang Control Flow Graph?<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>What about goto? I don't think you're going to be able to get out of a proper visited set.</div><div><br></div><br><div><div>On Aug 7, 2013, at 9:36 , Sung-Yee Guo <<a href="mailto:masoug@gmail.com">masoug@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;"><div>Thanks for the reply! I'll just check the block terminator type then.</div><div><br></div><div>-Masoug</div><div><br></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family: Calibri; font-size: 11pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);"><span style="font-weight:bold">From: </span> Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>><br><span style="font-weight:bold">Date: </span> Wednesday, August 7, 2013 9:30 AM<br><span style="font-weight:bold">To: </span> Sung-Yee Guo <<a href="mailto:masoug@gmail.com">masoug@gmail.com</a>><br><span style="font-weight:bold">Cc: </span> <<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>>, Developers <<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>><br><span style="font-weight:bold">Subject: </span> Re: [cfe-dev] Clang Control Flow Graph?<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi, Masoug. No, I don't think it's safe to make that assumption, even if it's true today. You'll have to use a visited set; llvm::SmallPtrSet should be able to handle it quite well.</div><div><br></div><div>Best,</div><div>Jordan</div><div><br></div><br><div><div>On Aug 6, 2013, at 18:37 , Sung-Yee Guo <<a href="mailto:masoug@gmail.com">masoug@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;"><div>Hi,</div><div>Just a quick question: Are the CFGBlock IDs <i>strictly</i> assigned in the depth-first order? I was trying to traverse the CFG but terminators like for loops "trap" me into an infinite loop; the successors have a path back to the predecessor of some blocks. My thinking was that if the block ids were assigned in a specific order, I may be able to use them as a way to avoid running into infinite loops (and stack overflows).</div><div><br></div><div>Thanks!</div><div>-Masoug</div></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div></div></span></div></blockquote></div><br></div></div></span></body></html>