def build(cpp_basename): tu = get_tu(cpp_basename) G = pygraphviz.AGraph(directed=True) for this, parent in ir.each_inheritance_relation(tu.cursor): print this,parent edge = (this, parent) G.add_edge(edge) return G
def build(): cpp_file_path = os.path.join(kInputsDir, 'main.cpp') index = Index.create() tu = index.parse(cpp_file_path) G = pygraphviz.AGraph(directed=True) for this, parent in ir.each_inheritance_relation(tu.cursor): edge = (this, parent) G.add_edge(edge) return G