diff options
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index ff6d293..06b030f 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -997,7 +997,7 @@ static bool isVarDeclStrongDefinition(const ASTContext &astContext, return true; if (const auto *rt = varType->getAs<RecordType>()) { - const RecordDecl *rd = rt->getDecl(); + const RecordDecl *rd = rt->getOriginalDecl()->getDefinitionOrSelf(); for (const FieldDecl *fd : rd->fields()) { if (fd->isBitField()) continue; @@ -2066,8 +2066,10 @@ CharUnits CIRGenModule::computeNonVirtualBaseClassOffset( // Get the layout. const ASTRecordLayout &layout = astContext.getASTRecordLayout(rd); - const auto *baseDecl = cast<CXXRecordDecl>( - base->getType()->castAs<clang::RecordType>()->getDecl()); + const auto *baseDecl = + cast<CXXRecordDecl>( + base->getType()->castAs<clang::RecordType>()->getOriginalDecl()) + ->getDefinitionOrSelf(); // Add the offset. offset += layout.getBaseClassOffset(baseDecl); |