CodeGenTypes::getCGRecordLayout(const RecordDecl *TD) const {
const Type *Key = Context.getTagDeclType(TD).getTypePtr();
const CGRecordLayout *Layout = CGRecordLayouts.lookup(Key);
+ if (!Layout) {
+ // Compute the type information.
+ ConvertTagDeclType(TD);
+
+ // Now try again.
+ Layout = CGRecordLayouts.lookup(Key);
+ }
+
assert(Layout && "Unable to find record layout information for type");
return *Layout;
}
/// and/or incomplete argument types, this will return the opaque type.
const llvm::Type *GetFunctionTypeForVTable(GlobalDecl GD);
- const CGRecordLayout &getCGRecordLayout(const RecordDecl*) const;
+ const CGRecordLayout &getCGRecordLayout(const RecordDecl*);
/// UpdateCompletedType - When we find the full definition for a TagDecl,
/// replace the 'opaque' type we previously made for it if applicable.