[cfe-commits] r159326 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/CodeGen/CGExprCXX.cpp test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp

John McCall rjmccall at apple.com
Thu Jun 28 10:22:45 PDT 2012


On Jun 28, 2012, at 8:34 AM, Rafael EspĂ­ndola wrote:
>> There's actually another problem that I hadn't initially considered, which
>> is that the final overrider may have a covariant return type requiring
>> adjustment.
>> 
>> I think we should just drop the optimization for now if the final overrider
>> is not the method that was type-checked against;  that will still catch
>> the most important case, which is when someone directly calls a
>> method on an object of final type but the method happens to be
>> implemented on a base class.  We can file a bug to revisit the more
>> aggressive optimization later.
> 
> Thanks again for showing that PR13142 was only the tip of the iceberg.
> Mozilla's code base has lots of cases of classes that can be marked
> final  and are accessed via macros with casts (which is how pr13142
> was found), so I just explicitly disabled the covariant case.
> 
> I have opened pr13227 to track the remaining cases.

Thanks!

John.



More information about the cfe-commits mailing list