<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 30, 2011, at 6:18 PM, Richard Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">It seems like we're no longer moving in this direction, but for posterity the<br>idea was to use the InstantiationDependent bit to indicate (as it currently<br>does) whether an Expr node is dependent, and if that bit is 0, use the<br>ValueDependent/TypeDependent bits to indicate if the node was instantiated<br>from a dependent node.<br></span></blockquote></div><div><br></div><div>This may be generally useful, but I'm dubious that analyzing templates for unreachable code is really worth the payoff of the complexity it will incur.  I painted a picture earlier of how instantiated code could have wildly different control-flow, but how much should we care about those issues in practice?  At the very least, however, we may get different CFGs for different template instantiations that have different basic blocks, different quantities of basic blocks, etc.  We'd need to correlate those results together to get reasonable results, and then that doesn't necessarily prove that the original template contains dead code  I'm skeptical that doing all the extra work to get this to dance for template instantiations will really be worth it compared to handling the common edge cases that happen in everyday code.</div></body></html>