diff --git a/stepper.py b/stepper.py index 8c70b6c..1edf7e4 100644 --- a/stepper.py +++ b/stepper.py @@ -22,6 +22,9 @@ def warn(msg): class Garbage(Enum): GARBAGE = '<>' + def __repr__(self): + return '<>' + def step(insns, terminator, blocks, stack_frames, ssa_env, global_env, heap, tdecs, fdecs, call_res): @@ -347,6 +350,8 @@ def ty2base_ty(ty, tdecs, seen=[]): if isinstance(ty, ll.SimpleType): return ty elif isinstance(ty, ll.PointerType): + # TODO: Consider if types behind pointers should not be + # expanded. They might be allowed for cyclic types return ll.PointerType(ty2base_ty(ty.inner_ty, tdecs, seen)) if isinstance(ty, ll.StructType): return ll.StructType([ty2base_ty(t, tdecs, seen) @@ -424,8 +429,10 @@ define i64 @tigermain (i64 %U_mainSL_8, i64 %U_mainDummy_9) { fdecs, call_res) step_cnt += 1 if terminator is None: - print('Stepping done! Final ssa_env:\n{}' + print('Stepping done!\nFinal ssa_env: {}' .format(ssa_env)) + print('Final heap: {}' + .format(heap)) print('Program resulted in {}'. format(insns[0][1].val)) break