Patch to fix an invalid AST of a locally redeclared built-in which causes an IRGen crash

jahanian fjahanian at apple.com
Wed May 21 16:43:53 PDT 2014


On May 21, 2014, at 4:29 PM, Richard Smith <richard at metafoo.co.uk> wrote:

> It's not OK to set a declaration invalid having only produced a warning.

Yes.  But this is a unique situation:

Both Old->getBuiltinID() and New-> getBuiltinID() refer to the same identifier
New->getIdentifier()->setBuiltinID(Builtin::NotBuiltin)  (which we must do because it is user declared)
makes “Old” as non-builtin as well. Not invalidating it we end up with a declaration of a built-in function
which has no built-in ID!
Is there an alternative? As things stand, we don’t keep source fidelity for local re-declaration
of a built-in function  (and IRGen doesn’t like that :).

- Fariborz


> 
> 
> On Wed, May 21, 2014 at 2:44 PM, jahanian <fjahanian at apple.com> wrote:
> Attached patch attempts to fix an IRGen crash caused by treating local redeclaration of a built-in function as a
> built-in.  This patch removes an exception where the AST node for local redeclaration of built-in function
> remains built-in. This causes the IRGen to treat the call to this function as built-in call resulting in crash.
> Patch removes this exception, but also makes the implicit declaration of the built-in function as invalid.
> Please review.
> 
> - Fariborz
> 
> 
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140521/31f1c21a/attachment.html>


More information about the cfe-commits mailing list