================
@@ -37,6 +50,32 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
     llvm_unreachable("Unsupported format for long double");
   }
 
+  /// Get a CIR record kind from a AST declaration tag.
+  cir::StructType::RecordKind getRecordKind(const clang::TagTypeKind kind) {
+    switch (kind) {
+    case clang::TagTypeKind::Struct:
+      return cir::StructType::Struct;
+    case clang::TagTypeKind::Union:
+      return cir::StructType::Union;
+    case clang::TagTypeKind::Class:
+      return cir::StructType::Class;
+    case clang::TagTypeKind::Interface:
+      llvm_unreachable("interface records are NYI");
+    case clang::TagTypeKind::Enum:
+      llvm_unreachable("enum records are NYI");
+    }
+  }
+
+  /// Get an incomplete CIR struct type.
+  cir::StructType getIncompleteStructTy(llvm::StringRef name,
+                                        const clang::RecordDecl *rd) {
+    const mlir::StringAttr nameAttr = getStringAttr(name);
+    cir::StructType::RecordKind kind = cir::StructType::RecordKind::Struct;
+    if (rd)
----------------
erichkeane wrote:
Should we/could we assert that `rd` represents an incomplete type?  Since the 
function name is asking for one?

https://github.com/llvm/llvm-project/pull/135105
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to