[cfe-commits] r159351 - in /cfe/trunk: lib/CodeGen/CGExprCXX.cpp test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
John McCall
rjmccall at apple.com
Thu Jun 28 10:23:26 PDT 2012
On Jun 28, 2012, at 8:11 AM, Rafael Espindola wrote:
> Author: rafael
> Date: Thu Jun 28 10:11:39 2012
> New Revision: 159351
>
> URL: http://llvm.org/viewvc/llvm-project?rev=159351&view=rev
> Log:
> Disable devirtualization when we have covariant returns. I will open a bug
> for tracking this.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGExprCXX.cpp
> cfe/trunk/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=159351&r1=159350&r2=159351&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Thu Jun 28 10:11:39 2012
> @@ -202,6 +202,9 @@
> // we don't have support for that yet, so do a virtual call.
> DevirtualizedMethod = NULL;
> }
> + if (DevirtualizedMethod && DevirtualizedMethod->getResultType() !=
> + MD->getResultType())
> + DevirtualizedMethod = NULL;
> }
This needs to use canonical types. Also, please add a comment explaining
why this is a problem.
John.
More information about the cfe-commits
mailing list