arichardson added a comment.

In D64128#1576391 <https://reviews.llvm.org/D64128#1576391>, @rjmccall wrote:

> I wouldn't favor adding something really obscure that was only useful for 
> clang, but I think builtins to set and clear mask bits while promising to 
> preserve object-reference identity would be more generally useful for 
> libraries.  For example, there might be somewhere in libc++ that could take 
> advantage of this.


This would be very useful for CHERI since in our architecture pointers 
(capabilties) carry provenance information at runtime.
The bitwise operations used by default sometimes make it unclear which 
provenance we should should use:  should the resulting value be a capability 
derived from the LHS or RHS?
Checking the value of low bits is especially awkward since it that case we 
would expect the result to be an invalid uintptr_t (derived from NULL instead 
of the LHS/RHS uintptr_t).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64128/new/

https://reviews.llvm.org/D64128



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to