@@ -248,7 +248,7 @@ Record *Program::getOrCreateRecord(const RecordDecl *RD) {
248
248
249
249
// Helper to get a base descriptor.
250
250
auto GetBaseDesc = [this ](const RecordDecl *BD,
251
- const Record *BR) -> Descriptor * {
251
+ const Record *BR) -> const Descriptor * {
252
252
if (!BR)
253
253
return nullptr ;
254
254
return allocateDescriptor (BD, BR, std::nullopt, /* isConst=*/ false ,
@@ -268,9 +268,9 @@ Record *Program::getOrCreateRecord(const RecordDecl *RD) {
268
268
// In error cases, the base might not be a RecordType.
269
269
if (const auto *RT = Spec.getType ()->getAs <RecordType>()) {
270
270
const RecordDecl *BD = RT->getDecl ();
271
+ const Record *BR = getOrCreateRecord (BD);
271
272
272
- Record *BR = getOrCreateRecord (BD);
273
- if (Descriptor *Desc = GetBaseDesc (BD, BR)) {
273
+ if (const Descriptor *Desc = GetBaseDesc (BD, BR)) {
274
274
BaseSize += align (sizeof (InlineDescriptor));
275
275
Bases.push_back ({BD, BaseSize, Desc, BR});
276
276
BaseSize += align (BR->getSize ());
@@ -284,9 +284,9 @@ Record *Program::getOrCreateRecord(const RecordDecl *RD) {
284
284
285
285
if (const auto *RT = Spec.getType ()->getAs <RecordType>()) {
286
286
const RecordDecl *BD = RT->getDecl ();
287
- Record *BR = getOrCreateRecord (BD);
287
+ const Record *BR = getOrCreateRecord (BD);
288
288
289
- if (Descriptor *Desc = GetBaseDesc (BD, BR)) {
289
+ if (const Descriptor *Desc = GetBaseDesc (BD, BR)) {
290
290
VirtSize += align (sizeof (InlineDescriptor));
291
291
VirtBases.push_back ({BD, VirtSize, Desc, BR});
292
292
VirtSize += align (BR->getSize ());
@@ -307,7 +307,7 @@ Record *Program::getOrCreateRecord(const RecordDecl *RD) {
307
307
QualType FT = FD->getType ();
308
308
const bool IsConst = FT.isConstQualified ();
309
309
const bool IsMutable = FD->isMutable ();
310
- Descriptor *Desc;
310
+ const Descriptor *Desc;
311
311
if (std::optional<PrimType> T = Ctx.classify (FT)) {
312
312
Desc = createDescriptor (FD, *T, std::nullopt, IsConst,
313
313
/* isTemporary=*/ false , IsMutable);
0 commit comments