Skip to content

Commit 7a5086e

Browse files
committed
update code
1 parent 8b765f9 commit 7a5086e

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

Generate_CFG_dataset/cfg.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
import linecache
1111
import random
1212

13-
# TODO later: graph
14-
'''
15-
1. add a color dictionary for condition calls
16-
2. node shape (may be added into class Block)
17-
'''
18-
1913
class SingletonMeta(type):
2014
_instance: Optional[BlockId] = None
2115

@@ -732,7 +726,6 @@ def visit_Assert(self, node):
732726
self.curr_block = self.add_edge(self.curr_block.bid, self.new_block().bid, node.test)
733727
self.generic_visit(node)
734728

735-
# TODO: change all those registers to stacks!
736729
def visit_Assign(self, node):
737730
if type(node.value) in [ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ast.Lambda] and len(node.targets) == 1 and type(node.targets[0]) == ast.Name: # is this entire statement necessary?
738731
if type(node.value) == ast.ListComp:
@@ -941,7 +934,6 @@ def visit_Raise(self, node):
941934
self.add_stmt(self.curr_block, node)
942935
self.curr_block = self.new_block()
943936

944-
# ToDO: final blocks to be add
945937
def visit_Return(self, node):
946938
if type(node.value) == ast.IfExp:
947939
self.ifExp = True

cfg.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
import linecache
1111
import random
1212

13-
# TODO later: graph
14-
'''
15-
1. add a color dictionary for condition calls
16-
2. node shape (may be added into class Block)
17-
'''
18-
1913
class SingletonMeta(type):
2014
_instance: Optional[BlockId] = None
2115

@@ -732,7 +726,6 @@ def visit_Assert(self, node):
732726
self.curr_block = self.add_edge(self.curr_block.bid, self.new_block().bid, node.test)
733727
self.generic_visit(node)
734728

735-
# TODO: change all those registers to stacks!
736729
def visit_Assign(self, node):
737730
if type(node.value) in [ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ast.Lambda] and len(node.targets) == 1 and type(node.targets[0]) == ast.Name: # is this entire statement necessary?
738731
if type(node.value) == ast.ListComp:
@@ -941,7 +934,6 @@ def visit_Raise(self, node):
941934
self.add_stmt(self.curr_block, node)
942935
self.curr_block = self.new_block()
943936

944-
# ToDO: final blocks to be add
945937
def visit_Return(self, node):
946938
if type(node.value) == ast.IfExp:
947939
self.ifExp = True

0 commit comments

Comments
 (0)