assert in getCGRecordLayout

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

assert in getCGRecordLayout

Jochen Wilhelmy
Hi!

If I do

codeGenTypes.getCGRecordLayout(recordDecl);

to get the layout of a struct (I derive from clang::CodeGenerator and
do it in HandleTopLevelDecl)
then getCGRecordLayout asserts if the recordDecl contains
an unknown type. Is there a possibility to find out if recordDecl
is valid? One solution could be that getCGRecordLayout  returns
a pointer that can be NULL on failure.

-Jochen
 
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: assert in getCGRecordLayout

Anders Carlsson
Hi Jochen,

you might want to call CodeGenTypes::ConvertType on the type that the record decl corresponds to first.

- Anders

8 maj 2010 kl. 15.12 skrev Jochen Wilhelmy:

> Hi!
>
> If I do
>
> codeGenTypes.getCGRecordLayout(recordDecl);
>
> to get the layout of a struct (I derive from clang::CodeGenerator and
> do it in HandleTopLevelDecl)
> then getCGRecordLayout asserts if the recordDecl contains
> an unknown type. Is there a possibility to find out if recordDecl
> is valid? One solution could be that getCGRecordLayout  returns
> a pointer that can be NULL on failure.
>
> -Jochen
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev