[clang] [CIR] Emit classic's attributes for a non-byval indirect argument (PR #222445)
Adam Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 10 13:01:57 PDT 2026
================
@@ -21,19 +21,20 @@ using namespace mlir::abi;
// This rewrite context supports the Direct (with or without coercion),
// Extend, Ignore, Indirect-return (sret), Indirect-argument (byval and
-// byref), and Expand (struct flattening) classifications.
+// non-byval), and Expand (struct flattening) classifications.
//
-// "byref" here is the llvm.byref case of an Indirect argument, not C++
-// pass-by-reference. A C++ reference parameter is already a pointer by the
-// time this classifier runs, so it classifies Direct. byref instead means
-// a by-value parameter whose type cannot be copied freely, because it has a
-// non-trivial copy constructor, move constructor, or destructor, so the ABI
-// passes it through a pointer instead of in registers.
+// An Indirect argument is byval or not, following its classification's
----------------
adams381 wrote:
Yes. Nothing in CIR uses `llvm.byref` after this, so the attribute is free for `IndirectAliased` to mean what it was added to mean.
https://github.com/llvm/llvm-project/pull/222445
More information about the cfe-commits
mailing list