[llvm] [CHERI] Add a Support utility for determining alignment requirements of CHERI capabilities. (PR #197402)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 6 11:38:48 PDT 2026


arichardson wrote:

> > Overall this looks sensible to me but I'm not convinced we need virtual functions here. Wouldn't something like what I did in the godbolt link be sufficient? Since there is no state, A class with static functions should be sufficient? And then we can keep it header only
> 
> I'm intentionally trying _not_ to have this be header only, so as not to bloat compile-time/code-size for code that has no particular need to be inlined into each instantiation.
> 

That's fine too, I was expecting there to only be one use of these in the lib/Target and one in LLD, but you're right it's probably cleaner to just push it into the .cpp file.

> That said, you're right that we don't need the virtual calls here. I just pushed a CRTP-based version that I think factors it nicely.



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


More information about the llvm-commits mailing list