Appearance
| 1 | namespace IR.Values.Load is | |
| 2 | use TypeTyped = Semantic.Types.Typed | |
| 3 | use Semantic.Types.Type | |
| 4 | ||
| 5 | // A load of a local, typed as the local unless given a type of its | |
| 6 | // own. | |
| 7 | class TEMP: Value, TypeTyped is | |
| 8 | local: IR.LOCAL | |
| 9 | ||
| 10 | type: Type | |
| 11 | ||
| 12 | has_address: bool => true | |
| 13 | is_lightweight_pure: bool => true | |
| 14 | ||
| 15 | init(local: IR.LOCAL) is | |
| 16 | self.init(local, local.type) | |
| 17 | si | |
| 18 | ||
| 19 | init(local: IR.LOCAL, type: Type) is | |
| 20 | self.local = local | |
| 21 | self.type = type | |
| 22 | si | |
| 23 | ||
| 24 | accept(visitor: Visitor) is | |
| 25 | visitor.visit(self) | |
| 26 | si | |
| 27 | ||
| 28 | accept_address(visitor: Visitor) is | |
| 29 | visitor.visit_address(self) | |
| 30 | si | |
| 31 | ||
| 32 | to_string() -> string => | |
| 33 | "load:[{type}]({local})" | |
| 34 | si | |
| 35 | si |