Remove everything after the first semicolon in the disassembly and trim any trailing spaces. This is necessary to remove the implicit operands we end up printing for Cranelift's sake.
(dis: &str)
| 245 | /// trailing spaces. This is necessary to remove the implicit operands we end up |
| 246 | /// printing for Cranelift's sake. |
| 247 | fn remove_after_semicolon(dis: &str) -> &str { |
| 248 | match dis.find(';') { |
| 249 | None => dis, |
| 250 | Some(idx) => { |
| 251 | let (prefix, _) = dis.split_at(idx); |
| 252 | prefix.trim() |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | #[test] |
| 258 | fn remove_after_parenthesis_test() { |