search for: sometraittypename__istype

Displaying 2 results from an estimated 2 matches for "sometraittypename__istype".

2017 May 16
2
[IR question] Switching on pointers
...lternatives, described by Sylvan Clebsch in the 6th message on the PR, would involve looking at whether the type descriptor of an object with an abstract type is the same as one of the subtypes of the abstract type being tested. Here's an equivalent C code from the github PR: bool SomeTraitTypeName__istype(pony_type_t* desc) { switch((uintptr_t)desc) { case 0x878AB00: case 0x878AB08: case 0x878AB16: case 0x878AC00: case 0x878AC08: case 0x878AD00: return true; default: {} } return false; }...
2017 May 15
6
[IR question] Switching on pointers
Hi. First of all, some context. I'm trying to implement a new functionality in an LLVM-based compiler and I need to take various actions based on the value of a given pointer, the possible values being the addresses of various global constants. I tried to use a `switch` instruction but I encountered several problems. The "ideal switch" I'd like to have would look