[cfe-commits] [patch] Falling off main() returns zero

Daniel Dunbar daniel at zuster.org
Mon Jul 27 14:54:47 PDT 2009


My initial reaction was to agree with Mike, but I think I've come
around to believing it should be in the AST.

However, to be consistent with our current design it should be clear
that this is an "implicit return 0". Presumably we have a spare bit
somewhere to encode this?

 - Daniel

On Mon, Jul 27, 2009 at 1:34 PM, Douglas Gregor<dgregor at apple.com> wrote:
>
> On Jul 27, 2009, at 12:38 PM, Fariborz Jahanian wrote:
>
>>
>> On Jul 27, 2009, at 12:22 PM, Mike Stump wrote:
>>
>>> On Jul 27, 2009, at 12:11 PM, Fariborz Jahanian wrote:
>>>> Code gen. Should not enforce language rules. This need to go into
>>>> AST
>>>> build.
>>>
>>> I like it in CG.  :-)
>>
>> Then make sure that rewriter, PCH, ... all do likewise. ASTs should be
>> complete when they get to theirs clients.
>
>
> I tend to agree with Fariborz... we're pretty careful about handling
> all of the language semantics as part of AST construction, so that
> CodeGen does not need to interpret language standards. It would be
> better to have Sema create an implicit ReturnStmt at the end of main
> (), adding an Implicit bit to ReturnStmt so that clients can determine
> whether the return was implicit.
>
>        - Doug
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list