def execute(self, fun):
     # (the CFG should be set up by this point, and the GIMPLE is not yet
     # in SSA form)
     if fun and fun.cfg:
         dot = cfg_to_dot(fun.cfg, fun.decl.name)
         # print dot
         invoke_dot(dot)
 def execute(self, fun):
     # (the CFG should be set up by this point, and the GIMPLE is not yet
     # in SSA form)
     if fun and fun.cfg:
         dot = cfg_to_dot(fun.cfg, fun.decl.name)
         # print dot
         invoke_dot(dot, name=fun.decl.name)
 def execute(self):
     # (the callgraph should be set up by this point)
     if gcc.is_lto():
         sg = Supergraph(split_phi_nodes=False,
                         add_fake_entry_node=False)
         dot = sg.to_dot('supergraph')
         invoke_dot(dot)
Beispiel #4
0
 def execute(self):
     # (the callgraph should be set up by this point)
     if gcc.is_lto():
         sg = Supergraph(split_phi_nodes=False,
                         add_fake_entry_node=False)
         dot = sg.to_dot('supergraph')
         if 0:
             invoke_dot(dot)
 def execute(self, fun):
     if fun.decl:
         log("Starting " + fun.decl.name)
         if show_cfg:
             dot = gccutils.cfg_to_dot(fun.cfg, fun.decl.name)
             gccutils.invoke_dot(dot, name=fun.decl.name)
     checker = CleanupChecker(fun)
     what = checker.check_cleanups()
     if fun.decl:
         log(fun.decl.name + ': ' + what, 2)
 def execute(self, fun):
     if fun.decl:
         log("Starting " + fun.decl.name)
         if show_cfg:
             dot = gccutils.cfg_to_dot(fun.cfg, fun.decl.name)
             gccutils.invoke_dot(dot, name=fun.decl.name)
     checker = CleanupChecker(fun)
     what = checker.check_cleanups()
     if fun.decl:
         log(fun.decl.name + ': ' + what, 2)
Beispiel #7
0
def on_pass_execution(p, fn):
    if p.name == '*free_lang_data':
        # The '*free_lang_data' pass is called once, rather than per-function,
        # and occurs immediately after "*build_cgraph_edges", which is the
        # pass that initially builds the callgraph
        #
        # So at this point we're likely to get a good view of the callgraph
        # before further optimization passes manipulate it
        dot = callgraph_to_dot()
        invoke_dot(dot)
Beispiel #8
0
def on_pass_execution(p, fn):
    #if p.name == '*warn_function_return':
    if p.name == '*free_lang_data':
        if 0:
            dot = callgraph_to_dot()
            invoke_dot(dot)

        for cgn in gcc.get_callgraph_nodes():
            print('cgn:')
            # print(dir(cgn))
            print('  cgn.decl: %r' % cgn.decl)
            print('  cgn.callers: %r' % cgn.callers)
            print('  cgn.callees: %r' % cgn.callees)
            for e in cgn.callers:
                print(e)
                print('e.caller: %r' % e.caller)
                print('e.callee: %r' % e.callee)
                print('e.call_stmt: %r %s' % (e.call_stmt, e.call_stmt))
Beispiel #9
0
 def execute(self, fun):
     # (the SSA form of each function should have just been set up)
     if fun and fun.cfg:
         dot = cfg_to_dot(fun.cfg, fun.decl.name)
         # print(dot)
         invoke_dot(dot, name=fun.decl.name)