Cleanup indentation and remove some dead code.

Analyze files not compiled using "-c".  This fixes:

<rdar://problem/5961638> invoke checker when gcc is not called with "-c"

llvm-svn: 51545
This commit is contained in:
Ted Kremenek 2008-05-24 15:58:54 +00:00
parent a08154d85f
commit f18f460716
1 changed files with 194 additions and 215 deletions

View File

@ -27,10 +27,6 @@ def quote(arg):
return arg
def run(args):
# We MUST print to stderr. Some clients use the stdout output of
# gcc for various purposes.
#print >> sys.stderr, ' '.join(map(quote, args))
#print >> sys.stderr
code = subprocess.call(args)
if code > 255:
code = 1
@ -38,9 +34,6 @@ def run(args):
sys.exit(code)
def compile(args):
# We MUST print to stderr. Some clients use the stdout output of
# gcc for various purposes.
#print >> sys.stderr, '\n'
command = 'gcc'.split()
run(command + args)
@ -65,7 +58,6 @@ def analyze(clang, args,language,output,files,verbose,htmldir,file,analysis_type
print_args.append(''.join([ '\'', args[i], '\'' ]))
i += 1
RunAnalyzer = 0;
if language.find("header") > 0:
@ -86,7 +78,7 @@ def analyze(clang, args,language,output,files,verbose,htmldir,file,analysis_type
args.append(htmldir)
print_args.append(htmldir)
if verbose:
if verbose == 1:
# We MUST print to stderr. Some clients use the stdout output of
# gcc for various purposes.
print >> sys.stderr, ' '.join(command+print_args)
@ -94,10 +86,6 @@ def analyze(clang, args,language,output,files,verbose,htmldir,file,analysis_type
subprocess.call(args)
def link(args):
command = 'gcc'.split()
run(command + args)
def extension(path):
return path.split(".")[-1]
@ -264,10 +252,7 @@ def main(args):
if not files:
error('no input files')
# if action == 'preprocess' or save_temps:
# compile(args)
if action == 'compile' or save_temps:
if action == 'compile' or save_temps or action == 'link':
for i, file in enumerate(files):
if not language:
language = inferlanguage(extension(file))
@ -287,12 +272,6 @@ def main(args):
analyze_args = [ '-x', language ] + analyze_args
analyze_args = analyze_args + compile_opts
analyze(clang, analyze_args, language, output, files, verbose, htmldir, file, analysis_type)
# compile(args)
# if action == 'link':
# link(args)
# # analyze(link_opts)
if __name__ == '__main__':
main(sys.argv[1:])