aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen/CIRGenModule.cpp
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2025-08-09 16:03:31 -0400
committerMichael Liao <michael.hliao@gmail.com>2025-08-09 16:38:49 -0400
commitc9b62427716f41cf33b932a5622d8ef5b588f1c0 (patch)
tree520b53223d4894d92e7dd4e889459fbb81899fca /clang/lib/CIR/CodeGen/CIRGenModule.cpp
parentd9199a85e1382a87aedc7edae30c98ef3f434308 (diff)
downloadllvm-c9b62427716f41cf33b932a5622d8ef5b588f1c0.zip
llvm-c9b62427716f41cf33b932a5622d8ef5b588f1c0.tar.gz
llvm-c9b62427716f41cf33b932a5622d8ef5b588f1c0.tar.bz2
[CIR] Fix build after the improved nested name specifier AST repr (91cdd35008e9)
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenModule.cpp8
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);