Lines Matching refs:args
41 args = parser.parse_args()
42 validate(parser, args, from_build_command)
45 initialize_logging(args.verbose)
46 logging.debug('Parsed arguments: %s', args)
48 with report_directory(args.output, args.keep_empty) as target_dir:
51 run_analyzer(args, target_dir)
52 number_of_bugs = document(args, target_dir, True)
53 return number_of_bugs if args.status_bugs else 0
54 elif args.intercept_first:
56 exit_code = capture(args, bin_dir)
58 if need_analyzer(args.build):
59 run_analyzer(args, target_dir)
61 number_of_bugs = document(args, target_dir, True)
63 if os.path.exists(args.cdb):
64 os.unlink(args.cdb)
66 return number_of_bugs if args.status_bugs else exit_code
72 environment = setup_environment(args, target_dir, bin_dir)
74 exit_code = subprocess.call(args.build, env=environment)
77 number_of_bugs = document(args, target_dir, False)
79 return number_of_bugs if args.status_bugs else exit_code
82 def need_analyzer(args): argument
92 return len(args) and not re.search('configure|autogen', args[0])
95 def run_analyzer(args, output_dir): argument
101 for directory in args.excludes)
104 'clang': args.clang,
106 'output_format': args.output_format,
107 'output_failures': args.output_failures,
108 'direct_args': analyzer_params(args),
109 'force_debug': args.force_debug
113 with open(args.cdb, 'r') as handle:
117 pool = multiprocessing.Pool(1 if args.verbose > 2 else None)
127 def setup_environment(args, destination, bin_dir): argument
134 'ANALYZE_BUILD_CC': args.cc,
135 'ANALYZE_BUILD_CXX': args.cxx,
136 'ANALYZE_BUILD_CLANG': args.clang if need_analyzer(args.build) else '',
137 'ANALYZE_BUILD_VERBOSE': 'DEBUG' if args.verbose > 2 else 'WARNING',
139 'ANALYZE_BUILD_REPORT_FORMAT': args.output_format,
140 'ANALYZE_BUILD_REPORT_FAILURES': 'yes' if args.output_failures else '',
141 'ANALYZE_BUILD_PARAMETERS': ' '.join(analyzer_params(args)),
142 'ANALYZE_BUILD_FORCE_DEBUG': 'yes' if args.force_debug else ''
194 def analyzer_params(args): argument
208 if args.store_model:
209 result.append('-analyzer-store={0}'.format(args.store_model))
210 if args.constraints_model:
212 args.constraints_model))
213 if args.internal_stats:
215 if args.analyze_headers:
217 if args.stats:
219 if args.maxloop:
220 result.extend(['-analyzer-max-loop', str(args.maxloop)])
221 if args.output_format:
222 result.append('-analyzer-output={0}'.format(args.output_format))
223 if args.analyzer_config:
224 result.append(args.analyzer_config)
225 if args.verbose >= 4:
227 if args.plugins:
228 result.extend(prefix_with('-load', args.plugins))
229 if args.enable_checker:
230 checkers = ','.join(args.enable_checker)
232 if args.disable_checker:
233 checkers = ','.join(args.disable_checker)
268 def validate(parser, args, from_build_command): argument
272 if args.help_checkers_verbose:
273 print_checkers(get_checkers(args.clang, args.plugins))
275 elif args.help_checkers:
276 print_active_checkers(get_checkers(args.clang, args.plugins))
279 if from_build_command and not args.build: