Improve presentation.

This commit is contained in:
cfreksen 2017-10-30 00:00:35 +01:00
parent 14d9215ac4
commit 5fc3e23ae5
No known key found for this signature in database
GPG Key ID: EAC13EE101008978
1 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,9 @@ def warn(msg):
class Garbage(Enum):
GARBAGE = '<<Unitialized memory>>'
def __repr__(self):
return '<<Garbage>>'
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