[cfe-dev] [PATCH]: Sema support for C++ classes
Chris Lattner
clattner at apple.com
Fri Jun 27 21:29:50 PDT 2008
On Jun 27, 2008, at 5:23 PM, Argiris Kirtzidis wrote:
>>> I'll fix this once Sema support is in place.
>>
>> Ok! One meta question: the PushDeclContext/pop context logic has
>> to keep the CurMethodDecl members up to date, and are somewhat
>> complex. Would it be better to change direct accesses to
>> CurMethodDecl to call getCurMethodDecl(), which would just look at
>> the current context?
>
> Sounds great! Shall I make a separate commit for this ?
Yes, please do it as a separate patch, thanks!
>> Are methods in C++ officially known as "member functions" or
>> "methods"?
>
> The standard uses "member functions".
Ok!
>> + else
>> + NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth);
>>
>> likewise.
>>
>
> Using plain FieldDecls for simple structs should be easy, I'm not
> sure about CXX/RecordDecl.
> Can we add this as is so we have the functionality and tests in, and
> later look for ways to optimize it ?
I'm fine with making it a fixme for now, and addressing it later as
functionality matures.
>> +Sema::DeclTy *
>> +Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS,
>> Declarator &D,
>>
>>
>> + assert(II && "No identifier ?");
>>
>> does this abort on unnamed bitfields like "int : 4;" ?
>
> This requires changes to the parser too. Can we fix it after the
> patch goes in so I can make one "unified" Parser+Sema+test commit,
> specific to this case ?
Yep, this patch is definite progress forward. I'm happy with forward
progress (even if it doesn't solve all problems) as long as it doesn't
regress anything that currently works.
Thanks Argiris!
-Chris
More information about the cfe-dev
mailing list