[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 10:15:51 PDT 2024


================
@@ -609,9 +609,25 @@ bool ConstStructBuilder::AppendBytes(CharUnits FieldOffsetInChars,
   return Builder.add(InitCst, StartOffset + FieldOffsetInChars, AllowOverwrite);
 }
 
-bool ConstStructBuilder::AppendBitField(
-    const FieldDecl *Field, uint64_t FieldOffset, llvm::ConstantInt *CI,
-    bool AllowOverwrite) {
+bool ConstStructBuilder::AppendBitField(const FieldDecl *Field,
+                                        uint64_t FieldOffset, llvm::Constant *C,
+                                        bool AllowOverwrite) {
+
+  llvm::ConstantInt *CI = dyn_cast<llvm::ConstantInt>(C);
+  if (!CI) {
+    // Constants for long _BitInt types are split into individual bytes.
----------------
rjmccall wrote:

```suggestion
    // Constants for _BitInt types are sometimes split into individual bytes.
```

Let's try to remember that this isn't *necessarily* a function of the size of the `_BitInt` type.

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


More information about the cfe-commits mailing list