aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen/CIRGenModule.cpp
diff options
context:
space:
mode:
authorAndy Kaylor <akaylor@nvidia.com>2025-06-06 12:54:43 -0700
committerGitHub <noreply@github.com>2025-06-06 12:54:43 -0700
commit16dda4d3f4051c449f59f98b69dddddf06b4648c (patch)
tree0e7eb2cefacb12b59422d2a577189f5ac43b86b8 /clang/lib/CIR/CodeGen/CIRGenModule.cpp
parent107601ed063f9e92aba61ea4f2a36c372127a82a (diff)
downloadllvm-16dda4d3f4051c449f59f98b69dddddf06b4648c.zip
llvm-16dda4d3f4051c449f59f98b69dddddf06b4648c.tar.gz
llvm-16dda4d3f4051c449f59f98b69dddddf06b4648c.tar.bz2
[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.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenModule.cpp6
1 files changed, 6 insertions, 0 deletions
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