[clang] [llvm] [CIR][ABI] Add ABI metadata fields to RecordType (PR #188300)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 17:38:27 PDT 2026


================
@@ -738,7 +738,25 @@ def CIR_RecordType : CIR_Type<"Record", "record", [
     }
 
     void complete(llvm::ArrayRef<mlir::Type> members, bool packed,
-                  bool isPadded);
+                  bool isPadded, bool canPassInRegisters = false,
+                  bool hasTrivialDestructor = true,
+                  uint64_t recordAlignInBytes = 0);
+
+    /// Whether the record can be passed in registers per the C++
+    /// ABI.  Wraps RecordDecl::canPassInRegisters().  Named
+    /// records default to false; anonymous records default to true.
+    bool getCanPassInRegisters() const;
----------------
andykaylor wrote:

I don't quite understand what it means, but I see that in the AST this has three possible states: `CanPassInRegs`, `CannotPassInRegs`, and `CanNeverPassInRegs`. Do we need to worry about that here?

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


More information about the cfe-commits mailing list