@samitouri / QOS-React-2 / commits / 096482e5cb

print mutable ranges on every place

useful for debugging

Joe Savona committed Jan 31, 2023 at 13:39 UTC 096482e5cbdc5f610dcdb29b57e6f421a1ebcda8
1 file changed +8 -5
compiler/forget/src/HIR/PrintHIR.ts
+8 -5
@@ -112,7 +112,7 @@ export function printInstruction(instr: ReactiveInstruction): string {
112 function printPhi(phi: Phi): string {
113 const items = [];
114 items.push(printIdentifier(phi.id));
115 - items.push(printMutableRange(phi.id));
115 + // items.push(printMutableRange(phi.id));
116 items.push(printType(phi.type));
117 items.push(": phi(");
118 const phis = [];
@@ -374,9 +374,7 @@ function printMutableRange(identifier: Identifier): string {
374 }
375
376 export function printLValue(lval: LValue): string {
377 - let lvalue = `${printPlace(lval.place)}${printMutableRange(
378 - lval.place.identifier
379 - )}`;
377 + let lvalue = `${printPlace(lval.place)}`;
378
379 switch (lval.kind) {
380 case InstructionKind.Let: {
@@ -395,7 +393,12 @@ export function printLValue(lval: LValue): string {
393 }
394
395 export function printPlace(place: Place): string {
398 - const items = [place.effect, " ", printIdentifier(place.identifier)];
396 + const items = [
397 + place.effect,
398 + " ",
399 + printIdentifier(place.identifier),
400 + printMutableRange(place.identifier),
401 + ];
402 items.push(printType(place.identifier.type));
403 return items.filter((x) => x != null).join("");
404 }