[cfe-commits] r57991 - in /cfe/trunk: include/clang/AST/DeclCXX.h include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Action.h include/clang/Parse/Parser.h lib/AST/DeclCXX.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDeclCX

Doug Gregor doug.gregor at gmail.com
Thu Oct 23 22:11:19 PDT 2008


On Thu, Oct 23, 2008 at 9:45 PM, Chris Lattner <clattner at apple.com> wrote:
> On Oct 23, 2008, at 8:53 AM, Doug Gregor wrote:
>> The annoying problem here is that we return CXXBaseSpecifier pointers
>> to the parser (as a BaseTy*, which is just a void*), when we'd really
>> prefer to just return a CXXBaseSpecifier. Anyway, I'll switch over to
>> an array of CXXBaseSpecifiers.
>
> Your follow-on commit looks like an awesome step, thanks!
>
> Is there a good way to fix this issue and avoid the new/delete pair in the
> common case?

Not that I found.

> It probably isn't worth the implementation effort, but one option would be
> to have a parser level version of 'CXXBaseSpecifier' and have the parser
> aggregate these together into a SmallVector and have Sema handle the whole
> list at once.  Base specifiers are probably not common enough to go to
> heroic measures to optimize, but it's an option. *shrug*

It might also be possible to do something akin to the
CXXFieldCollector, but for base classes. Then the parser could
potentially avoid having any representation of the base specifiers.

  - Doug



More information about the cfe-commits mailing list