From 16dda4d3f4051c449f59f98b69dddddf06b4648c Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 6 Jun 2025 12:54:43 -0700 Subject: [CIR] Add support for completing forward-declared types (#143176) This adds the needed handling for completing record types which were previously declared leading us to create an incomplete record type. --- clang/lib/CIR/CodeGen/CIRGenModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp') diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index ce3c57e..e5eae31 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -838,6 +838,11 @@ void CIRGenModule::maybeSetTrivialComdat(const Decl &d, mlir::Operation *op) { assert(!cir::MissingFeatures::opFuncSetComdat()); } +void CIRGenModule::updateCompletedType(const TagDecl *td) { + // Make sure that this type is translated. + genTypes.updateCompletedType(td); +} + // TODO(CIR): this could be a common method between LLVM codegen. static bool isVarDeclStrongDefinition(const ASTContext &astContext, CIRGenModule &cgm, const VarDecl *vd, @@ -1145,6 +1150,7 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) { // No code generation needed. case Decl::UsingShadow: + case Decl::Empty: break; // C++ Decls -- cgit v1.1