ORCA-C/CGI.Debug

1 line
8.7 KiB
Plaintext
Raw Normal View History

procedure InitWriteCode; {debug} { initialize the intermediate code opcode table } begin {InitWriteCode} opt[pc_adi] := 'adi'; opt[pc_adr] := 'adr'; opt[pc_psh] := 'psh'; opt[pc_and] := 'and'; opt[pc_dvi] := 'dvi'; opt[pc_dvr] := 'dvr'; opt[pc_cnn] := 'cnn'; opt[pc_cnv] := 'cnv'; opt[pc_ior] := 'ior'; opt[pc_mod] := 'mod'; opt[pc_mpi] := 'mpi'; opt[pc_mpr] := 'mpr'; opt[pc_ngi] := 'ngi'; opt[pc_ngr] := 'ngr'; opt[pc_not] := 'not'; opt[pc_sbi] := 'sbi'; opt[pc_sbr] := 'sbr'; opt[pc_sto] := 'sto'; opt[pc_dec] := 'dec'; opt[dc_loc] := 'LOC'; opt[pc_ent] := 'ent'; opt[pc_fjp] := 'fjp'; opt[pc_inc] := 'inc'; opt[pc_ind] := 'ind'; opt[pc_ixa] := 'ixa'; opt[pc_lao] := 'lao'; opt[pc_lca] := 'lca'; opt[pc_ldo] := 'ldo'; opt[pc_mov] := 'mov'; opt[pc_ret] := 'ret'; opt[pc_sro] := 'sro'; opt[pc_xjp] := 'xjp'; opt[pc_cup] := 'cup'; opt[pc_equ] := 'equ'; opt[pc_geq] := 'geq'; opt[pc_grt] := 'grt'; opt[pc_lda] := 'lda'; opt[pc_ldc] := 'ldc'; opt[pc_ldl] := 'ldl'; opt[pc_leq] := 'leq'; opt[pc_les] := 'les'; opt[pc_lil] := 'lil'; opt[pc_lld] := 'lld'; opt[pc_lli] := 'lli'; opt[pc_lod] := 'lod'; opt[pc_neq] := 'neq'; opt[pc_str] := 'str'; opt[pc_ujp] := 'ujp'; opt[pc_add] := 'add'; opt[pc_lnm] := 'lnm'; opt[pc_nam] := 'nam'; opt[pc_cui] := 'cui'; opt[pc_lad] := 'lad'; opt[pc_tjp] := 'tjp'; opt[dc_lab] := 'LAB'; opt[pc_usr] := 'usr'; opt[pc_umi] := 'umi'; opt[pc_udi] := 'udi'; opt[pc_uim] := 'uim'; opt[dc_enp] := 'ENP'; opt[pc_stk] := 'stk'; opt[dc_glb] := 'GLB'; opt[dc_dst] := 'DST'; opt[dc_str] := 'STR'; opt[pc_cop] := 'cop'; opt[pc_cpo] := 'cpo'; opt[pc_tl1] := 'tl1'; opt[dc_pin] := 'PIN'; opt[pc_shl] := 'shl'; opt[pc_shr] := 'shr'; opt[pc_bnd] := 'bnd'; opt[pc_bor] := 'bor'; opt[pc_bxr] := 'bxr'; opt[pc_bnt] := 'bnt'; opt[pc_bnl] := 'bnl'; opt[pc_mpl] := 'mpl'; opt[pc_dvl] := 'dvl'; opt[pc_mdl] := 'mdl'; opt[pc_sll] := 'sll'; opt[pc_slr] := 'slr'; opt[pc_bal] := 'bal'; opt[pc_ngl] := 'ngl'; opt[pc_adl] := 'adl'; opt[pc_sbl] := 'sbl'; opt[pc_blr] := 'blr'; opt[pc_blx] := 'blx'; opt[dc_sym] := 'SYM'; opt[pc_lnd] := 'lnd'; opt[pc_lor] := 'lor'; opt[pc_vsr] := 'vsr'; opt[pc_uml] := 'uml'; opt[pc_udl] := 'udl'; opt[pc_ulm] := 'ulm'; opt[pc_pop] := 'pop'; opt[pc_gil] := 'gil'; opt[pc_gli] := 'gli'; opt[pc_gdl] := 'gdl'; opt[pc_gld] := 'gld'; opt[pc_iil] := 'iil'; opt[pc_ili] := 'ili'; opt[pc_idl] := 'idl'; opt[pc_ild] := 'ild'; opt[pc_cpi] := 'cpi'; opt[pc_tri] := 'tri'; opt[pc_lbu] := 'lbu'; opt[pc_lbf] := 'lbf'; opt[pc_sbf] := 'sbf'; opt[pc_cbf] := 'cbf'; opt[dc_cns] := 'CNS'; opt[dc_prm] := 'PRM'; opt[pc_nat] := 'nat'; opt[pc_bno] := 'bno'; opt[pc_nop] := 'nop'; end; {InitWriteCode} procedure PrintDAG (tag: stringPtr; code: icptr); { print a DAG } { } { parameters: } { tag - label for lines } { code - first node in DAG } begin {PrintDAG} while code <> nil do begin PrintDAG(tag, code^.left); PrintDAG(tag, code^.right); write(tag^); WriteCode(code); code := code^.next; end; {while} end; {PrintDAG} procedure PrintBlocks {tag: stringPtr; bp: blockPtr}; {debug} { print a series of basic blocks } { } { parameters: } { tag - label for lines } { bp - first block to print } procedure PrintDOM (dp: blockListPtr); { print a list of dominators } { } { parameters: } { dp - list to print } begin {PrintDOM} while dp <> nil do begin write(dp^.dfn:1); if dp^.next <> nil then write(','); dp := dp^.next; end; {while} end; {PrintDOM} procedure PrintList (tag: stringPtr; lp: iclist); { print an operation list } { } { parameters: } { tag - label for lines } { lp - list to print } procedure PrintTree (tag: stringPtr; op: icptr); { print an operation tree } { } { parameters: } { tag - label for lines } { op - operation tree to print } begin {PrintTree} if op^.left <> nil then printTree(@'>> : ', op^.left); if