Appearance
| 1 | namespace IR.Values.Store is | |
| 2 | use Semantic.Types.Type; | |
| 3 | ||
| 4 | // Store a value through a managed pointer: the address-providing | |
| 5 | // LHS evaluates to a `T ref` whose stored value IS the address of | |
| 6 | // the pointee. | |
| 7 | class INDIRECT: Value is | |
| 8 | type: Type; | |
| 9 | address: Value; | |
| 10 | value: Value; | |
| 11 | ||
| 12 | init( | |
| 13 | address: Value, | |
| 14 | value: Value, | |
| 15 | type: Type | |
| 16 | ) is | |
| 17 | super.init(); | |
| 18 | ||
| 19 | self.address = address; | |
| 20 | self.value = value; | |
| 21 | self.type = type; | |
| 22 | si | |
| 23 | ||
| 24 | gen(context: IR.CONTEXT) is | |
| 25 | address.gen(context); | |
| 26 | value.gen(context); | |
| 27 | context.write_line("stobj {type.get_il_type()}"); | |
| 28 | si | |
| 29 | ||
| 30 | to_string() -> string => | |
| 31 | "store_indirect:[{type}]({address},{value})"; | |
| 32 | si | |
| 33 | si |