[cfe-commits] r70389 - in /cfe/trunk: include/clang/Parse/DeclSpec.h include/clang/Parse/Parser.h lib/Parse/DeclSpec.cpp lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseExpr.cpp lib/Sema/SemaDecl.cpp test/Parser/cxx-exception-spec.cpp www/cxx_status.html

Sebastian Redl sebastian.redl at getdesigned.at
Wed Apr 29 13:30:31 PDT 2009


Douglas Gregor wrote:
> On Apr 29, 2009, at 10:30 AM, Sebastian Redl wrote:
>
>> Author: cornedbee
>> Date: Wed Apr 29 12:30:04 2009
>> New Revision: 70389
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=70389&view=rev
>> Log:
>> Have the parser communicate the exception specification to the action.
>
> Oooh, I have a feeling you're going to run into C++'s "shadow type
> system" very soon :)
>
What? Are you talking about compatibility of functions and function
pointers with exception specifications?

>>
>> +    // FIXME: Does an empty vector ever allocate? Exception
>> specifications are
>> +    // extremely rare, so we want something like a
>> SmallVector<TypeTy*, 0>. :-)
>> +    std::vector<TypeTy*> Exceptions;
>
> I've never seen an std::vector that allocates. Now, it might be worth
> using a SmallVector<TypeTy*, 4>, just so that a one- or two-exception
> exception specification doesn't need to allocate. Besides, stack space
> is cheap :)
How often are non-empty exception specifications really used in
real-world code? As far as I know, everyone avoids them. They're ignored
by MSVC completely, and are a performance pessimization in exchange for
an inadequate exception translation mechanism everywhere else.

Sebastian



More information about the cfe-commits mailing list