コード例 #1
0
ファイル: commands.py プロジェクト: HUST-PLT/seahorn
    def run (self, args, extra):
        # do nothing on .bc and .ll files
        if _bc_or_ll_file (args.in_files[0]): return 0

        cmd_name = which (['clang-mp-3.6', 'clang-3.6', 'clang',
                                'clang-mp-3.5', 'clang-mp-3.4'])
        if cmd_name is None: raise IOError ('clang not found')
        self.clangCmd = sea.ExtCmd (cmd_name)

        argv = ['-c', '-emit-llvm', '-D__SEAHORN__', '-fgnu89-inline']

        argv.extend (filter (lambda s : s.startswith ('-D'), extra))

        if args.llvm_asm: argv.append ('-S')
        argv.append ('-m{0}'.format (args.machine))

        if args.debug_info: argv.append ('-g')

        if args.include_dir is not None:
            argv.append ('-I' + args.include_dir)

        include_dir = os.path.dirname (sys.argv[0])
        include_dir = os.path.dirname (include_dir)
        include_dir = os.path.join (include_dir, 'include')
        argv.append ('-I' + include_dir)

        if len(args.in_files) == 1:
            out_files = [args.out_file]
        else:
            # create private workdir
            workdir = createWorkDir (args.temp_dir, args.save_temps, 'clang-')
            out_files = [_remap_file_name (f, '.bc', workdir)
                         for f in args.in_files]

        for in_file, out_file in zip(args.in_files, out_files):
            if out_file is not None:
                argv.extend (['-o', out_file])

            # clone argv
            argv1 = list ()
            argv1.extend (argv)

            argv1.append (in_file)
            ret = self.clangCmd.run (args, argv1)
            if ret <> 0: return ret

        if len(out_files) > 1:
            # link
            cmd_name = which (['llvm-link-mp-3.6', 'llvm-link-3.6', 'llvm-link'])
            if cmd_name is None: raise IOError ('llvm-link not found')
            self.linkCmd = sea.ExtCmd (cmd_name)

            argv = []
            if args.llvm_asm: argv.append ('-S')
            if args.out_file is not None:
                argv.extend (['-o', args.out_file])
            argv.extend (out_files)
            return self.linkCmd.run (args, argv)

        return 0
コード例 #2
0
ファイル: commands.py プロジェクト: jiaqi-liu/seahorn
    def run (self, args, extra):
        # do nothing on .bc and .ll files
        if _bc_or_ll_file (args.in_files[0]): return 0

        cmd_name = which (['clang-mp-3.6', 'clang-3.6', 'clang',
                                'clang-mp-3.5', 'clang-mp-3.4'])
        if cmd_name is None: raise IOError ('clang not found')
        self.clangCmd = sea.ExtCmd (cmd_name)

        argv = ['-c', '-emit-llvm', '-D__SEAHORN__', '-fgnu89-inline']

        argv.extend (filter (lambda s : s.startswith ('-D'), extra))

        if args.llvm_asm: argv.append ('-S')
        argv.append ('-m{0}'.format (args.machine))

        if args.debug_info: argv.append ('-g')

        if args.include_dir is not None:
            argv.append ('-I' + args.include_dir)

        include_dir = os.path.dirname (sys.argv[0])
        include_dir = os.path.dirname (include_dir)
        include_dir = os.path.join (include_dir, 'include')
        argv.append ('-I' + include_dir)

        if len(args.in_files) == 1:
            out_files = [args.out_file]
        else:
            # create private workdir
            workdir = createWorkDir (args.temp_dir, args.save_temps, 'clang-')
            out_files = [_remap_file_name (f, '.bc', workdir)
                         for f in args.in_files]

        for in_file, out_file in zip(args.in_files, out_files):
            if out_file is not None:
                argv.extend (['-o', out_file])

            # clone argv
            argv1 = list ()
            argv1.extend (argv)

            argv1.append (in_file)
            ret = self.clangCmd.run (args, argv1)
            if ret <> 0: return ret

        if len(out_files) > 1:
            # link
            cmd_name = which (['llvm-link-mp-3.6', 'llvm-link-3.6', 'llvm-link'])
            if cmd_name is None: raise IOError ('llvm-link not found')
            self.linkCmd = sea.ExtCmd (cmd_name)

            argv = []
            if args.llvm_asm: argv.append ('-S')
            if args.out_file is not None:
                argv.extend (['-o', args.out_file])
            argv.extend (out_files)
            return self.linkCmd.run (args, argv)

        return 0
コード例 #3
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seahornCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.asm_out_file is not None: argv.extend (['-oll', args.asm_out_file])

        argv.extend (['-horn-inter-proc',
                      '-horn-format=clp', '-horn-sem-lvl=reg',
                      '--horn-step={0}'.format (args.step)])

        if args.clp_fapp:
            argv.extend (['--horn-clp-fapp'])

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])

        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.extend (args.in_files)

        # pick out extra seahorn options
        argv.extend (filter (_is_seahorn_opt, extra))


        return self.seahornCmd.run (args, argv)
コード例 #4
0
ファイル: commands.py プロジェクト: wuestholz/seahorn
    def run (self, args, extra):

        cmd_name = which (['clang++-mp-3.6', 'clang++-3.6', 'clang++',
                           'clang++-mp-3.5', 'clang++-mp-3.4'])
            
        if cmd_name is None: raise IOError ('clang++ not found')
        self.clangCmd = sea.ExtCmd (cmd_name)

        argv = []
        argv.append ('-m{0}'.format (args.machine))
        if args.debug_info: argv.append ('-g')

        if args.out_file is not None:
            argv.extend (['-o', args.out_file])

        assert (len (args.in_files) == 1)
        argv.append (args.in_files[0])
        
        lib_dir = os.path.dirname (sys.argv[0])
        lib_dir = os.path.dirname (lib_dir)
        lib_dir = os.path.join (lib_dir, 'lib')
        libseart = os.path.join (lib_dir, 'libsea-rt.a')
        argv.append (libseart)
        
        ret = self.clangCmd.run (args, argv)
        if ret <> 0: return ret
コード例 #5
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run(self, args, extra):
        cmd_name = which('seahorn')
        if cmd_name is None: raise IOError('seahorn not found')
        self.seahornCmd = sea.ExtCmd(cmd_name)

        argv = list()
        if args.solve: argv.append('--horn-solve')
        if args.cex is not None and args.solve:
            argv.append('-horn-cex')
            argv.append('-horn-svcomp-cex={0}'.format(args.cex))
            argv.extend(['-log', 'cex'])
        if args.asm_out_file is not None:
            argv.extend(['-oll', args.asm_out_file])

        argv.extend([
            '-horn-inter-proc', '-horn-sem-lvl={0}'.format(args.track),
            '--horn-step={0}'.format(args.step)
        ])

        if args.verbose > 0: argv.extend(['-zverbose', str(args.verbose)])

        if args.log is not None:
            for l in args.log.split(':'):
                argv.extend(['-log', l])
        if args.ztrace is not None:
            for l in args.ztrace.split(':'):
                argv.extend(['-ztrace', l])

        if args.out_file is not None: argv.extend(['-o', args.out_file])
        argv.append(args.in_file)

        # pick out extra seahorn options
        argv.extend(filter(_is_seahorn_opt, extra))

        return self.seahornCmd.run(args, argv)
コード例 #6
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seahornCmd = sea.ExtCmd (cmd_name)
        
        argv = list()
        if args.solve: argv.append ('--horn-solve')
        if args.cex is not None and args.solve:
            argv.append ('-horn-cex')
            argv.append ('-horn-svcomp-cex={0}'.format (args.cex))
            argv.extend (['-log', 'cex'])
        if args.asm_out_file is not None: argv.extend (['-oll', args.asm_out_file])
        
        argv.extend (['-horn-inter-proc',
                      '-horn-sem-lvl={0}'.format (args.track),
                      '--horn-step={0}'.format (args.step)])
        
        if args.verbose > 0: argv.extend (['-zverbose', str(args.verbose)])

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])
        if args.ztrace is not None:
            for l in args.ztrace.split (':'): argv.extend (['-ztrace', l])
        
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.append (args.in_file)

        # pick out extra seahorn options
        argv.extend (filter (_is_seahorn_opt, extra))
        
            
        return self.seahornCmd.run (args, argv)
コード例 #7
0
    def run(self, args, extra):
        cmd_name = which(['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None:
            raise IOError('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd(cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend(['-o', args.out_file])
        if args.opt_level > 0 and args.opt_level <= 3:
            argv.append('-O{0}'.format(args.opt_level))

        if not args.enable_indvar:
            argv.append('--enable-indvar=false')
        if not args.enable_loop_idiom:
            argv.append('--enable-loop-idiom=false')
        if not args.enable_nondet_init:
            argv.append('--enable-nondet-init=false')
        if args.inline_threshold is not None:
            argv.append(
                '--inline-threshold={t}'.format(t=args.inline_threshold))

        argv.extend(args.in_files)
        if args.llvm_asm: argv.append('-S')
        return self.seaoptCmd.run(args, argv)
コード例 #8
0
    def run(self, args, extra):
        cmd_name = which(['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None:
            raise IOError('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd(cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend(['-o', args.out_file])

        # fake loops to be in the form suitable for loop-unroll
        argv.append('-fake-latch-exit')

        argv.append('-loop-unroll')
        if args.enable_runtime:
            argv.append('-unroll-runtime')
        if args.enable_partial:
            argv.append('-unroll-allow-partial')
        if args.bound > 0:
            argv.append('-unroll-count={b}'.format(b=args.bound))
        argv.append('-unroll-threshold={t}'.format(t=args.threshold))

        argv.extend(args.in_files)
        if args.llvm_asm: argv.append('-S')
        return self.seaoptCmd.run(args, argv)
コード例 #9
0
    def run(self, args, extra):
        cmd_name = which('seahorn')
        if cmd_name is None: raise IOError('seahorn not found')
        self.seahornCmd = sea.ExtCmd(cmd_name)

        argv = list()
        if args.asm_out_file is not None:
            argv.extend(['-oll', args.asm_out_file])

        argv.extend([
            '-horn-inter-proc', '-horn-format=clp', '-horn-sem-lvl=reg',
            '--horn-step={0}'.format(args.step)
        ])

        if args.clp_fapp:
            argv.extend(['--horn-clp-fapp'])

        if args.log is not None:
            for l in args.log.split(':'):
                argv.extend(['-log', l])

        if args.out_file is not None: argv.extend(['-o', args.out_file])
        argv.extend(args.in_files)

        # pick out extra seahorn options
        argv.extend(filter(_is_seahorn_opt, extra))

        return self.seahornCmd.run(args, argv)
コード例 #10
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
 def run (self, args, extra):
     cmd_name = which ('seapp')
     if cmd_name is None: raise IOError ('seapp not found')
     self.seappCmd = sea.ExtCmd (cmd_name)
     
     argv = list()
     if args.out_file is not None: argv.extend (['-o', args.out_file])
     if args.inline: argv.append ('--horn-inline-all')
     if args.llvm_asm: argv.append ('-S')
     argv.append (args.in_file)
     return self.seappCmd.run (args, argv)
コード例 #11
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run(self, args, extra):
        cmd_name = which('seapp')
        if cmd_name is None: raise IOError('seapp not found')
        self.seappCmd = sea.ExtCmd(cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend(['-o', args.out_file])
        if args.inline: argv.append('--horn-inline-all')
        if args.llvm_asm: argv.append('-S')
        argv.append(args.in_file)
        return self.seappCmd.run(args, argv)
コード例 #12
0
ファイル: commands.py プロジェクト: wuestholz/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        if args.llvm_asm: argv.append ('-S')
        
        # internalize takes precedence over all other options and must run alone
        if self._strip_extern:
            argv.append ('--only-strip-extern=true')
        elif args.internalize:
            argv.append ('--klee-internalize')
        else:
            if args.inline: argv.append ('--horn-inline-all')

            if args.strip_external:
                argv.append ('--strip-extern=true')
            else:
                argv.append ('--strip-extern=false')

            if args.lower_invoke:
                argv.append ('--lower-invoke')

            if args.devirt_funcs:
                argv.append ('--devirt-functions')

            if args.enable_ext_funcs:
                argv.append ('--externalize-addr-taken-funcs')

            if args.enum_verifier_calls:
                argv.append ('--enum-verifier-calls')

            if args.boc:
                argv.append ('--bounds-check')
            if args.ioc:
                argv.append ('--overflow-check')
            if args.ndc:
                argv.append ('--null-check')

            if args.entry is not None:
                argv.append ('--entry-point={0}'.format (args.entry))

            if args.kill_vaarg:
                argv.append('--kill-vaarg=true')
            else:
                argv.append('--kill-vaarg=false')
                
        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])

        argv.extend (args.in_files)
        return self.seappCmd.run (args, argv)
コード例 #13
0
    def run(self, args, extra):
        cmd_name = which('seapp')
        if cmd_name is None: raise IOError('seapp not found')
        self.seappCmd = sea.ExtCmd(cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend(['-o', args.out_file])
        if not args.ms_skip: argv.append('--horn-mixed-sem')
        if args.reduce_main: argv.append('--ms-reduce-main')
        if args.llvm_asm: argv.append('-S')
        argv.extend(args.in_files)
        return self.seappCmd.run(args, argv)
コード例 #14
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        if not args.ms_skip: argv.append ('--horn-mixed-sem')
        if args.reduce_main: argv.append ('--ms-reduce-main')
        if args.llvm_asm: argv.append ('-S')
        argv.extend (args.in_files)
        return self.seappCmd.run (args, argv)
コード例 #15
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run (self, args, extra):
        cmd_name = which (['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None: raise IOError ('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd (cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend (['-o', args.out_file])
        if args.opt_level > 0 and args.opt_level <= 3:
            argv.append('-O{0}'.format (args.opt_level))
        argv.append (args.in_file)
        if args.llvm_asm: argv.append ('-S')
        return self.seaoptCmd.run (args, argv)
コード例 #16
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run(self, args, extra):
        cmd_name = which(['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None:
            raise IOError('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd(cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend(['-o', args.out_file])
        if args.opt_level > 0 and args.opt_level <= 3:
            argv.append('-O{0}'.format(args.opt_level))
        argv.append(args.in_file)
        if args.llvm_asm: argv.append('-S')
        return self.seaoptCmd.run(args, argv)
コード例 #17
0
ファイル: commands.py プロジェクト: peterschrammel/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seahornCmd = sea.ExtCmd (cmd_name)
        
        argv = list()

        if args.crab:
            argv.append ('--horn-crab')
            argv.append ('--crab-dom={0}'.format (args.crab_dom))
            #argv.append ('--crab-track-lvl={0}'.format (args.track))
            if args.crab_disable_ptr:
                argv.append ('--crab-enable-ptr')
            if args.crab_cfg_simplify:
                argv.append ('--crab-cfg-simplify')
            if args.crab_interproc:
                argv.append ('--crab-cfg-interproc')
            if args.crab_live:
                argv.append ('--crab-live')

        if args.solve:
            argv.append ('--horn-solve')
            if args.show_invars:
                argv.append ('--horn-answer')
        if args.cex is not None and args.solve:
            argv.append ('-horn-cex')
            argv.append ('-horn-svcomp-cex={0}'.format (args.cex))
            argv.extend (['-log', 'cex'])
        if args.asm_out_file is not None: argv.extend (['-oll', args.asm_out_file])
        
        argv.extend (['-horn-inter-proc',
                      '-horn-sem-lvl={0}'.format (args.track),
                      '--horn-step={0}'.format (args.step)])
        
        if args.verbose > 0: argv.extend (['-zverbose', str(args.verbose)])

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])
        if args.ztrace is not None:
            for l in args.ztrace.split (':'): argv.extend (['-ztrace', l])
        
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.append (args.in_file)

        # pick out extra seahorn options
        argv.extend (filter (_is_seahorn_opt, extra))
        
            
        return self.seahornCmd.run (args, argv)
コード例 #18
0
    def run(self, args, extra):
        cmd_name = which('seahorn')
        if cmd_name is None: raise IOError('seahorn not found')
        self.seahornCmd = sea.ExtCmd(cmd_name)

        argv = list()

        if args.bmc:
            argv.append('--horn-bmc')

        # if args.crab:
        #     argv.append ('--horn-crab')

        if args.solve or args.out_file is not None:
            argv.append('--keep-shadows=true')

        if args.solve:
            argv.append('--horn-solve')
            # Cannot delete shadows since they are used by the solver
            if args.show_invars:
                argv.append('--horn-answer')
        if args.cex is not None and args.solve:
            argv.append('-horn-cex-pass')
            argv.append('-horn-cex={0}'.format(args.cex))
            #argv.extend (['-log', 'cex'])
        if args.asm_out_file is not None:
            argv.extend(['-oll', args.asm_out_file])

        argv.extend([
            '-horn-inter-proc', '-horn-sem-lvl={0}'.format(args.track),
            '--horn-step={0}'.format(args.step)
        ])

        if args.verbose > 0: argv.extend(['-zverbose', str(args.verbose)])

        if args.log is not None:
            for l in args.log.split(':'):
                argv.extend(['-log', l])
        if args.ztrace is not None:
            for l in args.ztrace.split(':'):
                argv.extend(['-ztrace', l])

        if args.out_file is not None: argv.extend(['-o', args.out_file])
        argv.extend(args.in_files)

        # pick out extra seahorn options
        argv.extend(filter(_is_seahorn_opt, extra))

        return self.seahornCmd.run(args, argv)
コード例 #19
0
ファイル: commands.py プロジェクト: jiaqi-liu/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.append ('--horn-cut-loops')
        if args.llvm_asm: argv.append ('-S')
        argv.extend (args.in_files)

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])

        return self.seappCmd.run (args, argv)
コード例 #20
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.append ('--horn-cut-loops')
        if args.llvm_asm: argv.append ('-S')
        argv.extend (args.in_files)

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])

        return self.seappCmd.run (args, argv)
コード例 #21
0
ファイル: commands.py プロジェクト: wuestholz/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        if args.wmem_skip:
            if args.out_file is not None:
                shutil.copy2 (args.in_files[0], args.out_file)
            return 0
        else:
            argv = list()
            if args.out_file is not None: argv.extend (['-o', args.out_file])
            argv.append ('--wrap-mem')
            if args.llvm_asm: argv.append ('-S')
            argv.extend (args.in_files)
            return self.seappCmd.run (args, argv)
コード例 #22
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seahornCmd = sea.ExtCmd (cmd_name)

        argv = list()

        if args.crab:
            argv.append ('--horn-crab')
            argv.append ('--crab-dom={0}'.format (args.crab_dom))
            argv.append ('--crab-track-lvl={0}'.format (args.crab_track))
            if args.crab_inter:
                argv.append ('--crab-inter')

        if args.solve or args.out_file is not None:
            argv.append ('--keep-shadows=true')
            
        if args.solve:
            argv.append ('--horn-solve')
            # Cannot delete shadows since they are used by the solver
            if args.show_invars:
                argv.append ('--horn-answer')
        if args.cex is not None and args.solve:
            argv.append ('-horn-cex')
            argv.append ('-horn-svcomp-cex={0}'.format (args.cex))
            #argv.extend (['-log', 'cex'])
        if args.asm_out_file is not None: argv.extend (['-oll', args.asm_out_file])

        argv.extend (['-horn-inter-proc',
                      '-horn-sem-lvl={0}'.format (args.track),
                      '--horn-step={0}'.format (args.step)])

        if args.verbose > 0: argv.extend (['-zverbose', str(args.verbose)])

        if args.log is not None:
            for l in args.log.split (':'): argv.extend (['-log', l])
        if args.ztrace is not None:
            for l in args.ztrace.split (':'): argv.extend (['-ztrace', l])

        if args.out_file is not None: argv.extend (['-o', args.out_file])
        argv.extend (args.in_files)

        # pick out extra seahorn options
        argv.extend (filter (_is_seahorn_opt, extra))


        return self.seahornCmd.run (args, argv)
コード例 #23
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run (self, args, extra):
        # do nothing on .bc and .ll files
        if _bc_or_ll_file (args.in_file): return 0

        cmd_name = which (['clang-mp-3.6', 'clang-3.6', 'clang',
                                'clang-mp-3.5', 'clang-mp-3.4'])
        if cmd_name is None: raise IOError ('clang not found')
        self.clangCmd = sea.ExtCmd (cmd_name)
        
        argv = ['-c', '-emit-llvm']
        if args.llvm_asm: argv.append ('-S')
        argv.append ('-m{0}'.format (args.machine))
        
        if args.debug_info: argv.append ('-g')
        if args.out_file is not None:
            argv.extend (['-o', args.out_file])
        argv.append (args.in_file)
        return self.clangCmd.run (args, argv)
コード例 #24
0
    def run(self, args, extra):
        cmd_name = which('seahorn')
        if cmd_name is None: raise IOError('seahorn not found')
        self.seappCmd = sea.ExtCmd(cmd_name)

        argv = list()

        argv.append('--horn-crab')
        argv.append('--crab-add-invariants-at-entries')
        argv.append('--crab-add-invariants-after-loads')

        if args.out_file is not None: argv.extend(['-oll', args.out_file])
        argv.extend(args.in_files)

        # pick out extra seahorn options
        argv.extend(filter(_is_seahorn_opt, extra))

        return self.seappCmd.run(args, argv)
コード例 #25
0
ファイル: commands.py プロジェクト: gitter-badger/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()

        argv.append ('--horn-crab')
        argv.append ('--crab-add-invariants-at-entries')
        argv.append ('--crab-add-invariants-after-loads')

        if args.out_file is not None: argv.extend (['-oll', args.out_file])
        argv.extend (args.in_files)

        # pick out extra seahorn options
        argv.extend (filter (_is_seahorn_opt, extra))

        return self.seappCmd.run (args, argv)
コード例 #26
0
ファイル: commands.py プロジェクト: locasto/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        if args.inline: argv.append ('--horn-inline-all')

        if args.strip_external:
            argv.append ('--strip-extern=true')
        else:
            argv.append ('--strip-extern=false')

        if args.lower_invoke:
            argv.append ('--lower-invoke')

        if args.devirt_funcs:
            argv.append ('--devirt-functions')

        if args.enable_ext_funcs:
            argv.append ('--externalize-addr-taken-funcs')

        if args.enum_verifier_calls:
            argv.append ('--enum-verifier-calls')

        if args.boc:
            argv.append ('--bounds-check')
        if args.ioc:
            argv.append ('--overflow-check')
        if args.ndc:
            argv.append ('--null-check')

        if args.entry is not None:
            argv.append ('--entry-point={0}'.format (args.entry))

        if args.kill_vaarg:
            argv.append('--kill-vaarg=true')
        else:
            argv.append('--kill-vaarg=false')

        if args.llvm_asm: argv.append ('-S')
        argv.extend (args.in_files)
        return self.seappCmd.run (args, argv)
コード例 #27
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which ('seahorn')
        if cmd_name is None: raise IOError ('seahorn not found')
        self.seappCmd = sea.ExtCmd (cmd_name)

        argv = list()
        argv.append ('--horn-crab')
        argv.append ('--crab-dom={0}'.format (args.crab_dom))
        argv.append ('--crab-track-lvl={0}'.format (args.crab_track))
        if args.crab_inter:
                argv.append ('--crab-inter')
        #if args.insert_entries:
        argv.append ('--crab-add-invariants-at-entries')
        #if args.insert_loads:
        argv.append ('--crab-add-invariants-after-loads')

        if args.out_file is not None: argv.extend (['-oll', args.out_file])
        argv.extend (args.in_files)
        return self.seappCmd.run (args, argv)
コード例 #28
0
ファイル: commands.py プロジェクト: hkhlaaf/seahorn
    def run(self, args, extra):
        # do nothing on .bc and .ll files
        if _bc_or_ll_file(args.in_file): return 0

        cmd_name = which([
            'clang-mp-3.6', 'clang-3.6', 'clang', 'clang-mp-3.5',
            'clang-mp-3.4'
        ])
        if cmd_name is None: raise IOError('clang not found')
        self.clangCmd = sea.ExtCmd(cmd_name)

        argv = ['-c', '-emit-llvm']
        if args.llvm_asm: argv.append('-S')
        argv.append('-m{0}'.format(args.machine))

        if args.debug_info: argv.append('-g')
        if args.out_file is not None:
            argv.extend(['-o', args.out_file])
        argv.append(args.in_file)
        return self.clangCmd.run(args, argv)
コード例 #29
0
ファイル: commands.py プロジェクト: jeffgennari/seahorn
    def run(self, args, extra):
        cmd_name = which('seapp')
        if cmd_name is None: raise IOError('seapp not found')
        self.seappCmd = sea.ExtCmd(cmd_name)

        argv = list()
        if args.out_file is not None: argv.extend(['-o', args.out_file])
        if args.inline: argv.append('--horn-inline-all')

        if args.strip_external:
            argv.append('--strip-extern=true')
        else:
            argv.append('--strip-extern=false')

        if args.lower_invoke:
            argv.append('--lower-invoke')

        if args.devirt_funcs:
            argv.append('--devirt-functions')

        if args.enable_ext_funcs:
            argv.append('--externalize-addr-taken-funcs')

        if args.boc:
            argv.append('--bounds-check')
        if args.ioc:
            argv.append('--overflow-check')
        if args.ndc:
            argv.append('--null-check')

        if args.entry is not None:
            argv.append('--entry-point={0}'.format(args.entry))

        if args.kill_vaarg:
            argv.append('--kill-vaarg=true')
        else:
            argv.append('--kill-vaarg=false')

        if args.llvm_asm: argv.append('-S')
        argv.extend(args.in_files)
        return self.seappCmd.run(args, argv)
コード例 #30
0
ファイル: commands.py プロジェクト: peterschrammel/seahorn
    def run (self, args, extra):
        cmd_name = which (['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None: raise IOError ('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd (cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend (['-o', args.out_file])
        if args.opt_level > 0 and args.opt_level <= 3:
            argv.append('-O{0}'.format (args.opt_level))
            
        if not args.enable_indvar:
            argv.append ('--enable-indvar=false')
        if not args.enable_loop_idiom:
            argv.append ('--enable-loop-idiom=false')
        if not args.enable_nondet_init:
            argv.append ('--enable-nondet-init=false')
            
        argv.append (args.in_file)
        if args.llvm_asm: argv.append ('-S')
        return self.seaoptCmd.run (args, argv)
コード例 #31
0
ファイル: commands.py プロジェクト: SUTD/seahorn
    def run (self, args, extra):
        cmd_name = which (['seaopt', 'opt-mp-3.6', 'opt-3.6', 'opt'])
        if cmd_name is None: raise IOError ('neither seaopt nor opt where found')
        self.seaoptCmd = sea.ExtCmd (cmd_name)

        argv = ['-f', '-funit-at-a-time']
        if args.out_file is not None:
            argv.extend (['-o', args.out_file])

        # fake loops to be in the form suitable for loop-unroll
        argv.append ('-fake-latch-exit')
        
        argv.append ('-loop-unroll')
        if args.enable_runtime:
            argv.append ('-unroll-runtime')
        if args.enable_partial:
            argv.append ('-unroll-allow-partial')
        if args.bound > 0:
            argv.append ('-unroll-count={b}'.format(b=args.bound))
        argv.append ('-unroll-threshold={t}'.format(t=args.threshold))

        argv.extend (args.in_files)
        if args.llvm_asm: argv.append ('-S')
        return self.seaoptCmd.run (args, argv)    
コード例 #32
0
ファイル: commands.py プロジェクト: peterschrammel/seahorn
    def run (self, args, extra):
        cmd_name = which ('seapp')
        if cmd_name is None: raise IOError ('seapp not found')
        self.seappCmd = sea.ExtCmd (cmd_name)
        
        argv = list()
        if args.out_file is not None: argv.extend (['-o', args.out_file])
        if args.inline: argv.append ('--horn-inline-all')
        if args.boc:
            if args.inline:
                argv.append ('--boc-inline-all')
            else:
                argv.append ('--boc')
        if args.ioc:
            if args.inline:
                argv.append ('--ioc-inline-all')
            else:
                argv.append ('--ioc')
        if args.entry is not None:
            argv.append ('--entry-point=\"{0}\"'.format (args.entry))

        if args.llvm_asm: argv.append ('-S')
        argv.append (args.in_file)
        return self.seappCmd.run (args, argv)