[cfe-commits] [PATCH] Fix tag decls/enum constants in function prototypes

Chandler Carruth chandlerc at google.com
Wed Feb 1 00:43:22 PST 2012


Haven't yet done a full review, sorry for the delays, but wanted to ask one
question that jumped out at me. Maybe you can explain and save me the
trouble of tracking it down.

On Tue, Jan 31, 2012 at 1:41 AM, James Molloy <james.molloy at arm.com> wrote:

> This is due to a hack in the parser that hangs such tags on the
> translation unit because no proper declcontext is available at that point.
> I've modified my code so it catches this and unhooks them from the
> translation unit, so they don't get visited twice and the output is better.


It would seem more clean to go in and fix the code that attaches these to
the translation unit to not do so? The current pattern seems very
inconsistent. It also means we're mutating the AST in weird ways. That
makes me nervous. I'd essentially like to see far fewer conditionals when
handling these declarations. We should be able to unconditionally set up
the lexical context, attach to the function, and push onto the scope... If
there are conditions on these steps, I would benefit from comments
documenting why we don't have consistent behavior...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120201/ac810e0b/attachment.html>


More information about the cfe-commits mailing list