<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 21, 2014, at 4:29 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">It's not OK to set a declaration invalid having only produced a warning.</div></blockquote><div><br></div><div>Yes.  But this is a unique situation:</div></div><div><br></div><div>Both <span style="font-family: Menlo; font-size: 11px;">Old-></span><span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">getBuiltinID</span><span style="font-family: Menlo; font-size: 11px;">() and </span><span style="font-family: Menlo; font-size: 11px;">New-></span> <span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">getBuiltinID() refer to the same identifier</span></div><div><span style="font-family: Menlo; font-size: 11px;">New-></span><span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">getIdentifier</span><span style="font-family: Menlo; font-size: 11px;">()-></span><span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">setBuiltinID</span><span style="font-family: Menlo; font-size: 11px;">(</span><span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">Builtin</span><span style="font-family: Menlo; font-size: 11px;">::</span><span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">NotBuiltin</span><span style="font-family: Menlo; font-size: 11px;">)  (which we must do because it is user declared)</span></div><div><font face="Menlo"><span style="font-size: 11px;">makes “Old” as non-builtin as well. </span></font><span style="font-size: 11px; font-family: Menlo;">Not invalidating it we end up with a declaration of a built-in function</span></div><div><font face="Menlo"><span style="font-size: 11px;">which has no built-in ID!</span></font></div><div><font face="Menlo"><span style="font-size: 11px;">Is there an alternative? As things stand, we don’t keep source fidelity for local re-declaration</span></font></div><div><font face="Menlo"><span style="font-size: 11px;">of a built-in function  (and IRGen doesn’t like that :).</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div><font face="Menlo"><span style="font-size: 11px;">- Fariborz</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div><br><blockquote type="cite"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 2:44 PM, jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Attached patch attempts to fix an IRGen crash caused by treating local redeclaration of a built-in function as a<br>
built-in.  This patch removes an exception where the AST node for local redeclaration of built-in function<br>
remains built-in. This causes the IRGen to treat the call to this function as built-in call resulting in crash.<br>
Patch removes this exception, but also makes the implicit declaration of the built-in function as invalid.<br>
Please review.<br>
<br>
- Fariborz<br>
<br>
<br>
<br><br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></body></html>