aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen/CIRGenModule.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2025-08-26 16:05:59 -0300
committerGitHub <noreply@github.com>2025-08-26 16:05:59 -0300
commit2ec71d93ad888d9523425930ef8c35fe8f0b2485 (patch)
treee2a0c680ae74184edaee5cbe4df8794f4915f667 /clang/lib/CIR/CodeGen/CIRGenModule.cpp
parent2bfbae99b93ab17cf6a53d826301ba51c52b6129 (diff)
downloadllvm-2ec71d93ad888d9523425930ef8c35fe8f0b2485.zip
llvm-2ec71d93ad888d9523425930ef8c35fe8f0b2485.tar.gz
llvm-2ec71d93ad888d9523425930ef8c35fe8f0b2485.tar.bz2
[clang] NFC: introduce Type::getAsEnumDecl, and cast variants for all TagDecls (#155463)
And make use of those. These changes are split from prior PR #155028, in order to decrease the size of that PR and facilitate review.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenModule.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 08b40e0..c7f5484 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -2180,10 +2180,7 @@ CharUnits CIRGenModule::computeNonVirtualBaseClassOffset(
// Get the layout.
const ASTRecordLayout &layout = astContext.getASTRecordLayout(rd);
- const auto *baseDecl =
- cast<CXXRecordDecl>(
- base->getType()->castAs<clang::RecordType>()->getOriginalDecl())
- ->getDefinitionOrSelf();
+ const auto *baseDecl = base->getType()->castAsCXXRecordDecl();
// Add the offset.
offset += layout.getBaseClassOffset(baseDecl);