[llvm] [IR] Add initial support for the byte type (PR #178666)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 08:51:24 PST 2026


================
@@ -1396,6 +1365,40 @@ LLVM_C_ABI void LLVMDumpType(LLVMTypeRef Val);
  */
 LLVM_C_ABI char *LLVMPrintTypeToString(LLVMTypeRef Val);
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup LLVMCCoreTypeByte Byte Types
+ *
+ * Functions in this section operate on byte types.
+ *
+ * @{
+ */
+
+/**
+ * Obtain a byte type from a context with specified bit width.
+ */
+LLVMTypeRef LLVMByte8TypeInContext(LLVMContextRef C);
+LLVMTypeRef LLVMByte16TypeInContext(LLVMContextRef C);
+LLVMTypeRef LLVMByte32TypeInContext(LLVMContextRef C);
+LLVMTypeRef LLVMByte64TypeInContext(LLVMContextRef C);
+LLVMTypeRef LLVMByte128TypeInContext(LLVMContextRef C);
+LLVMTypeRef LLVMByteTypeInContext(LLVMContextRef C, unsigned NumBits);
----------------
nikic wrote:

For the purposes of the C API, I think we should only have LLVMByteTypeInContext and LLVMByteType. Don't really see a point in having extra fixed-size variants in the API surface.

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


More information about the llvm-commits mailing list