Merge branch 'dev' into dev-ssa

pull/87/head
Josselin 6 years ago
commit 9d1400b504
  1. 4
      slither/__main__.py
  2. 24
      slither/printers/functions/cfg.py

@ -169,6 +169,7 @@ def get_detectors_and_printers():
from slither.printers.summary.slithir import PrinterSlithIR
from slither.printers.summary.slithir_ssa import PrinterSlithIRSSA
from slither.printers.summary.human_summary import PrinterHumanSummary
from slither.printers.functions.cfg import CFG
printers = [FunctionSummary,
ContractSummary,
@ -178,7 +179,8 @@ def get_detectors_and_printers():
PrinterWrittenVariablesAndAuthorization,
PrinterSlithIR,
PrinterSlithIRSSA,
PrinterHumanSummary]
PrinterHumanSummary,
CFG]
# Handle plugins!
for entry_point in iter_entry_points(group='slither_analyzer.plugin', name=None):

@ -0,0 +1,24 @@
"""
"""
from slither.printers.abstract_printer import AbstractPrinter
from slither.core.declarations.function import Function
class CFG(AbstractPrinter):
ARGUMENT = 'cfg'
HELP = 'Export the CFG of each functions'
def output(self, original_filename):
"""
_filename is not used
Args:
_filename(string)
"""
for contract in self.contracts:
for function in contract.functions + contract.modifiers:
filename = "{}-{}-{}.dot".format(original_filename, contract.name, function.full_name)
self.info('Export {}'.format(filename))
function.slithir_cfg_to_dot(filename)
Loading…
Cancel
Save