[llvm] RuntimeLibcalls: Add function signatures to RTLIB. (PR #226264)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 12:07:26 PDT 2026


================
@@ -154,6 +155,46 @@ static IntegerType *getSizeTType(LLVMContext &Ctx, const DataLayout &DL) {
   return DL.getIndexType(Ctx, /*AddressSpace=*/0);
 }
 
+static Type *convertToIRType(FuncArgTypeID ID, LLVMContext &Ctx,
+                             const Triple &TT, const DataLayout &DL) {
+
+  unsigned IntBits = TT.isArch16Bit() ? 16 : 32;
+
+  switch (ID) {
+  case Void:
+    return Type::getVoidTy(Ctx);
+  case Bool:
+    return IntegerType::get(Ctx, 8);
+  case Int16:
+    return IntegerType::get(Ctx, 16);
+  case Int32:
+    return IntegerType::get(Ctx, 32);
+  case Int:
+  case IntPlus:
+  case Long:
+  case IntX:
+    return IntegerType::get(Ctx, IntBits);
+  case LLong:
+    return IntegerType::get(Ctx, 64);
+  case SizeT:
+  case SSizeT:
+    return getSizeTType(Ctx, DL);
+  case Flt:
+  case Floating:
+    return Type::getFloatTy(Ctx);
+  case Dbl:
+    return Type::getDoubleTy(Ctx);
+  case LDbl:
+    return Type::getDoubleTy(Ctx);
+  case Ptr:
+    return PointerType::get(Ctx, 0);
+  case Struct:
+    return nullptr; // This typy is not used.
----------------
arsenm wrote:

```suggestion
    return nullptr; // This type is not used.
```

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


More information about the llvm-commits mailing list