On May 21, 2014, at 4:29 PM, Richard Smith <[email protected]> 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 <[email protected]> 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
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to