The ccc-analyzer script now interrogates environment variables to determine

where to dump HTML reports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48987 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2008-03-31 18:25:05 +00:00
Родитель 615f517709
Коммит 09c2ad63c3
1 изменённых файлов: 23 добавлений и 9 удалений

Просмотреть файл

@ -45,14 +45,14 @@ def remove_pch_extension(path):
return path return path
return path[:i] return path[:i]
def analyze(args,language,output,files): def analyze(args,language,output,files,verbose,htmldir):
if language.find("c++") > 0: if language.find("c++") > 0:
return return
print >> sys.stderr, ' '.join(['\n[LOCATION]:', os.getcwd(), '\n' ])
print_args = [] print_args = []
if verbose:
print >> sys.stderr, ' '.join(['\n[LOCATION]:', os.getcwd(), '\n' ])
i = 0 i = 0
while i < len(args): while i < len(args):
print_args.append(''.join([ '\'', args[i], '\'' ])) print_args.append(''.join([ '\'', args[i], '\'' ]))
@ -64,10 +64,14 @@ def analyze(args,language,output,files):
args = command + files + target.split() args = command + files + target.split()
else: else:
command = 'clang --grsimple'.split() command = 'clang --grsimple'.split()
args = command + args args = command + args + [ '-o', htmldir ]
print_args.append('-o')
print_args.append(htmldir)
if verbose:
print >> sys.stderr, ' '.join(command+print_args) print >> sys.stderr, ' '.join(command+print_args)
print >> sys.stderr, '\n' print >> sys.stderr, '\n'
subprocess.call(args) subprocess.call(args)
def link(args): def link(args):
@ -111,6 +115,16 @@ def main(args):
save_temps = 0 save_temps = 0
language = '' language = ''
verbose = 0
if os.environ.get('CCC_ANALYZER_VERBOSE') is not None:
verbose =1
htmldir = os.environ.get('CCC_ANALYZER_HTML')
if htmldir is None:
print >> sys.stderr, 'error: CCC_ANALYZER_HTML environment variable not set.'
sys.exit(1)
i = 0 i = 0
while i < len(args): while i < len(args):
arg = args[i] arg = args[i]
@ -208,7 +222,7 @@ def main(args):
if language != 'unknown': if language != 'unknown':
analyze_args = analyze_args + [ '-x', language ] analyze_args = analyze_args + [ '-x', language ]
analyze_args = analyze_args + compile_opts analyze_args = analyze_args + compile_opts
analyze(analyze_args,language,output,files) analyze(analyze_args, language, output, files, verbose, htmldir)
compile(args) compile(args)