Tell LLVM about read-only captures

`&Freeze` parameters are not only `readonly` within the function,
but any captures of the pointer can also only be used for reads.
This can now be encoded using the `captures(address, read_provenance)`
attribute.
This commit is contained in:
Nikita Popov
2025-08-11 17:18:23 +02:00
parent 8365fcb2b8
commit d71ed8d19b
10 changed files with 48 additions and 14 deletions

View File

@@ -251,6 +251,7 @@ pub(crate) enum AttributeKind {
Writable = 42,
DeadOnUnwind = 43,
DeadOnReturn = 44,
CapturesReadOnly = 45,
}
/// LLVMIntPredicate