[llvm] [C API] Add getters for Target Extension Types to C API (PR #71291)

Joshua Cranmer via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 13:44:05 PST 2023


================
@@ -157,8 +157,42 @@ struct TypeCloner {
         return LLVMX86MMXTypeInContext(Ctx);
       case LLVMTokenTypeKind:
         return LLVMTokenTypeInContext(Ctx);
-      case LLVMTargetExtTypeKind:
-        assert(false && "Implement me");
+      case LLVMTargetExtTypeKind: {
+        const char *Name = LLVMGetTargetExtTypeName(Src);
+        unsigned TypeParamCount = LLVMCountTargetExtTypeTypeParams(Src);
+        unsigned IntParamCount = LLVMCountTargetExtTypeIntParams(Src);
+
+        LLVMTypeRef *TypeParams = nullptr;
+        unsigned *IntParams = nullptr;
----------------
jcranmer-intel wrote:

These types should be `SmallVector<LLVMTypeRef, 4>` and `SmallVector<unsigned, 4>`, respectively...

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


More information about the llvm-commits mailing list