From dc8596d5485a52abee2967cec72f81ef4872270c Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 25 Aug 2025 20:18:56 -0300 Subject: [clang] NFC: change more places to use Type::getAsTagDecl and friends (#155313) This changes a bunch of places which use getAs, including derived types, just to obtain the tag definition. This is preparation for #155028, offloading all the changes that PR used to introduce which don't depend on any new helpers. --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 7140b81..7064421 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6075,8 +6075,7 @@ static bool isVarDeclStrongDefinition(const ASTContext &Context, if (Context.isAlignmentRequired(VarType)) return true; - if (const auto *RT = VarType->getAs()) { - const RecordDecl *RD = RT->getOriginalDecl()->getDefinitionOrSelf(); + if (const auto *RD = VarType->getAsRecordDecl()) { for (const FieldDecl *FD : RD->fields()) { if (FD->isBitField()) continue; -- cgit v1.1