[cfe-commits] r90149 - /cfe/trunk/lib/CodeGen/CGVtable.cpp

Mike Stump mrs at apple.com
Mon Nov 30 15:26:35 PST 2009


On Nov 30, 2009, at 11:43 AM, Anders Carlsson wrote:
> Author: andersca
> Date: Mon Nov 30 13:43:26 2009
> New Revision: 90149
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=90149&view=rev
> Log:
> Fix an assert.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGVtable.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90149&r1=90148&r2=90149&view=diff
> 
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGVtable.cpp Mon Nov 30 13:43:26 2009
> @@ -867,8 +867,8 @@
>   const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
> 
>   if (PrimaryBase) {
> -    assert(PrimaryBase->isCanonicalDecl() && 
> -           "Should have the canonical decl of the primary base!");
> +    assert(PrimaryBase->isDefinition() && 
> +           "Should have the definition decl of the primary base!");

The mental model I was using was that we are playing with canonical types through this entire file.  The assert was to ensure that was true.  By stepping back to a non-canonical type, I fear we'll just discover much later on we're in the weeds when something went wrong.  I think I'd rather have a switch to the canonical type, or change the primary to be canonical during record layout.



More information about the cfe-commits mailing list