CTSRD-CHERI / clang

DO NOT USE. Use llvm-project instead
Other
9 stars 8 forks source link

Casting capabilities to [u]intcap_t #169

Closed khilangudka closed 6 years ago

khilangudka commented 6 years ago

Currently these are implemented internally in Clang with the PointerToIntegral cast kind. @davidchisnall suggested that these should really be BitCasts.

I started implementing this but then ran into a few cases where I wasn't sure about what the behaviour should be, such as for case statements. These are in the test cases:

test/CodeGen/intcapswitch.c test/Sema/cheri-intcap-constant.c test/CodeGen/cheri-intcap-constant.c

Should there be implicit casts inserted or should the programmer be explicit? If implicit, then what should the behaviour be?