Prim returns a representation of the high-level control flow primitive, as a mapping from control flow primitive node names to control flow graph node names. Example mapping: "cond": "A" "body_true": "B" "body_false": "C" "exit": "D"
()
| 40 | // "body_false": "C" |
| 41 | // "exit": "D" |
| 42 | func (prim IfElse) Prim() *primitive.Primitive { |
| 43 | cond, bodyTrue, bodyFalse, exit := label(prim.Cond), label(prim.BodyTrue), label(prim.BodyFalse), label(prim.Exit) |
| 44 | return &primitive.Primitive{ |
| 45 | Prim: "if_else", |
| 46 | Nodes: map[string]string{ |
| 47 | "cond": cond, |
| 48 | "body_true": bodyTrue, |
| 49 | "body_false": bodyFalse, |
| 50 | "exit": exit, |
| 51 | }, |
| 52 | Entry: cond, |
| 53 | Exit: exit, |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // String returns a string representation of prim in DOT format. |
| 58 | // |