[clang] [CIR] Upstream enum support (PR #136807)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 30 14:32:10 PDT 2025


================
@@ -399,6 +399,14 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
     break;
   }
 
+  case Type::Enum: {
+    const EnumDecl *ED = cast<EnumType>(ty)->getDecl();
+    if (ED->isCompleteDefinition() || ED->isFixed())
+      return convertType(ED->getIntegerType());
----------------
bcardosolopes wrote:

> do you think this is the best approach?

Works for me!

https://github.com/llvm/llvm-project/pull/136807


More information about the cfe-commits mailing list