about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-05-11 17:52:00 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-08-21 05:27:14 +0400
commit10270f4b442207b23b28f776b8dda297bd03570a (patch)
tree64993fc370f2192d32582e631d5cf924fa77bb98 /compiler/rustc_span/src
parent48853a361a5ff0e8215301c62f259a26eed7aa72 (diff)
downloadrust-10270f4b442207b23b28f776b8dda297bd03570a.tar.gz
rust-10270f4b442207b23b28f776b8dda297bd03570a.zip
Add pointer masking convenience functions
This commit adds the following functions all of which have a signature
`pointer, usize -> pointer`:
- `<*mut T>::mask`
- `<*const T>::mask`
- `intrinsics::ptr_mask`

These functions are equivalent to `.map_addr(|a| a & mask)` but they
utilize `llvm.ptrmask` llvm intrinsic.

*masks your pointers*
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/symbol.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 156f53ac486..19e136a4476 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1112,6 +1112,7 @@ symbols! {
         ptr,
         ptr_guaranteed_eq,
         ptr_guaranteed_ne,
+        ptr_mask,
         ptr_null,
         ptr_null_mut,
         ptr_offset_from,