summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build-py/libscanbuild/arguments.py
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-03-01 12:43:39 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-03-01 12:43:39 +0000
commitd49e75afbdad10e86ef5bfb6d53b86e2f7c63e50 (patch)
treea485d726e2dd09f22774afd1a91ba7563870676b /clang/tools/scan-build-py/libscanbuild/arguments.py
parentb068b037937d6088255562858ee82381bb1de424 (diff)
downloadbcm5719-llvm-d49e75afbdad10e86ef5bfb6d53b86e2f7c63e50.tar.gz
bcm5719-llvm-d49e75afbdad10e86ef5bfb6d53b86e2f7c63e50.zip
Revert "[analyzer] Support for naive cross translation unit analysis"
Also revert "[analyzer] Fix a compiler warning" This reverts commits r326323 and r326324. Reason: the commits introduced a cyclic dependency in the build graph. This happens to work with cmake, but breaks out internal integrate. llvm-svn: 326432
Diffstat (limited to 'clang/tools/scan-build-py/libscanbuild/arguments.py')
-rw-r--r--clang/tools/scan-build-py/libscanbuild/arguments.py76
1 files changed, 3 insertions, 73 deletions
diff --git a/clang/tools/scan-build-py/libscanbuild/arguments.py b/clang/tools/scan-build-py/libscanbuild/arguments.py
index 00679a45937..2735123f9f1 100644
--- a/clang/tools/scan-build-py/libscanbuild/arguments.py
+++ b/clang/tools/scan-build-py/libscanbuild/arguments.py
@@ -18,8 +18,8 @@ import sys
import argparse
import logging
import tempfile
-from libscanbuild import reconfigure_logging, CtuConfig
-from libscanbuild.clang import get_checkers, is_ctu_capable
+from libscanbuild import reconfigure_logging
+from libscanbuild.clang import get_checkers
__all__ = ['parse_args_for_intercept_build', 'parse_args_for_analyze_build',
'parse_args_for_scan_build']
@@ -98,11 +98,6 @@ def normalize_args_for_analyze(args, from_build_command):
# add cdb parameter invisibly to make report module working.
args.cdb = 'compile_commands.json'
- # Make ctu_dir an abspath as it is needed inside clang
- if not from_build_command and hasattr(args, 'ctu_phases') \
- and hasattr(args.ctu_phases, 'dir'):
- args.ctu_dir = os.path.abspath(args.ctu_dir)
-
def validate_args_for_analyze(parser, args, from_build_command):
""" Command line parsing is done by the argparse module, but semantic
@@ -127,18 +122,6 @@ def validate_args_for_analyze(parser, args, from_build_command):
elif not from_build_command and not os.path.exists(args.cdb):
parser.error(message='compilation database is missing')
- # If the user wants CTU mode
- if not from_build_command and hasattr(args, 'ctu_phases') \
- and hasattr(args.ctu_phases, 'dir'):
- # If CTU analyze_only, the input directory should exist
- if args.ctu_phases.analyze and not args.ctu_phases.collect \
- and not os.path.exists(args.ctu_dir):
- parser.error(message='missing CTU directory')
- # Check CTU capability via checking clang-func-mapping
- if not is_ctu_capable(args.func_map_cmd):
- parser.error(message="""This version of clang does not support CTU
- functionality or clang-func-mapping command not found.""")
-
def create_intercept_parser():
""" Creates a parser for command-line arguments to 'intercept'. """
@@ -235,15 +218,7 @@ def create_analyze_parser(from_build_command):
default='html',
action='store_const',
help="""Cause the results as a set of .html and .plist files.""")
- format_group.add_argument(
- '--plist-multi-file',
- '-plist-multi-file',
- dest='output_format',
- const='plist-multi-file',
- default='html',
- action='store_const',
- help="""Cause the results as a set of .plist files with extra
- information on related files.""")
+ # TODO: implement '-view '
advanced = parser.add_argument_group('advanced options')
advanced.add_argument(
@@ -358,51 +333,6 @@ def create_analyze_parser(from_build_command):
if from_build_command:
parser.add_argument(
dest='build', nargs=argparse.REMAINDER, help="""Command to run.""")
- else:
- ctu = parser.add_argument_group('cross translation unit analysis')
- ctu_mutex_group = ctu.add_mutually_exclusive_group()
- ctu_mutex_group.add_argument(
- '--ctu',
- action='store_const',
- const=CtuConfig(collect=True, analyze=True,
- dir='', func_map_cmd=''),
- dest='ctu_phases',
- help="""Perform cross translation unit (ctu) analysis (both collect
- and analyze phases) using default <ctu-dir> for temporary output.
- At the end of the analysis, the temporary directory is removed.""")
- ctu.add_argument(
- '--ctu-dir',
- metavar='<ctu-dir>',
- dest='ctu_dir',
- default='ctu-dir',
- help="""Defines the temporary directory used between ctu
- phases.""")
- ctu_mutex_group.add_argument(
- '--ctu-collect-only',
- action='store_const',
- const=CtuConfig(collect=True, analyze=False,
- dir='', func_map_cmd=''),
- dest='ctu_phases',
- help="""Perform only the collect phase of ctu.
- Keep <ctu-dir> for further use.""")
- ctu_mutex_group.add_argument(
- '--ctu-analyze-only',
- action='store_const',
- const=CtuConfig(collect=False, analyze=True,
- dir='', func_map_cmd=''),
- dest='ctu_phases',
- help="""Perform only the analyze phase of ctu. <ctu-dir> should be
- present and will not be removed after analysis.""")
- ctu.add_argument(
- '--use-func-map-cmd',
- metavar='<path>',
- dest='func_map_cmd',
- default='clang-func-mapping',
- help="""'%(prog)s' uses the 'clang-func-mapping' executable
- relative to itself for generating function maps for static
- analysis. One can override this behavior with this option by using
- the 'clang-func-mapping' packaged with Xcode (on OS X) or from the
- PATH.""")
return parser
OpenPOWER on IntegriCloud