зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
615f517709
Коммит
09c2ad63c3
|
@ -45,14 +45,14 @@ def remove_pch_extension(path):
|
|||
return path
|
||||
return path[:i]
|
||||
|
||||
def analyze(args,language,output,files):
|
||||
def analyze(args,language,output,files,verbose,htmldir):
|
||||
if language.find("c++") > 0:
|
||||
return
|
||||
|
||||
print >> sys.stderr, ' '.join(['\n[LOCATION]:', os.getcwd(), '\n' ])
|
||||
|
||||
print_args = []
|
||||
|
||||
if verbose:
|
||||
print >> sys.stderr, ' '.join(['\n[LOCATION]:', os.getcwd(), '\n' ])
|
||||
i = 0
|
||||
while i < len(args):
|
||||
print_args.append(''.join([ '\'', args[i], '\'' ]))
|
||||
|
@ -64,10 +64,14 @@ def analyze(args,language,output,files):
|
|||
args = command + files + target.split()
|
||||
else:
|
||||
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, '\n'
|
||||
|
||||
subprocess.call(args)
|
||||
|
||||
def link(args):
|
||||
|
@ -111,6 +115,16 @@ def main(args):
|
|||
save_temps = 0
|
||||
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
|
||||
while i < len(args):
|
||||
arg = args[i]
|
||||
|
@ -208,7 +222,7 @@ def main(args):
|
|||
if language != 'unknown':
|
||||
analyze_args = analyze_args + [ '-x', language ]
|
||||
analyze_args = analyze_args + compile_opts
|
||||
analyze(analyze_args,language,output,files)
|
||||
analyze(analyze_args, language, output, files, verbose, htmldir)
|
||||
compile(args)
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче