disable dead code checker on clang

Summary:
This was turned on by mistake.

closes #373

Reviewed By: cristianoc

Differential Revision: D3384850

fbshipit-source-id: fe7cefa
master
Jules Villard 9 years ago committed by Facebook Github Bot 2
parent 8613f16c19
commit d2f7cb44fa

@ -99,6 +99,14 @@ def create_argparser(parents=[]):
return parser return parser
def validate_args(mode, args):
if mode is not None and mode.LANG == ['clang'] and \
args.analyzer == config.ANALYZER_CHECKERS:
utils.stderr('error: checkers are only enabled for Java.')
if not args.debug:
exit(1)
def main(): def main():
toplevel_envvar_value = os.environ.get(TOP_LEVEL_ENVVAR, None) toplevel_envvar_value = os.environ.get(TOP_LEVEL_ENVVAR, None)
is_toplevel_instance = False is_toplevel_instance = False
@ -125,14 +133,16 @@ def main():
args = global_argparser.parse_args(to_parse) args = global_argparser.parse_args(to_parse)
remove_infer_out = (imported_module validate_args(imported_module, args)
remove_infer_out = (imported_module is not None
and not args.reactive and not args.reactive
and capture_module_name != 'analyze' and capture_module_name != 'analyze'
and not args.buck) and not args.buck)
if remove_infer_out: if remove_infer_out:
analyze.remove_infer_out(args.infer_out) analyze.remove_infer_out(args.infer_out)
if imported_module: if imported_module is not None:
analyze.create_results_dir(args.infer_out) analyze.create_results_dir(args.infer_out)
analyze.reset_start_file(args.infer_out, analyze.reset_start_file(args.infer_out,
touch_if_present=not args.continue_capture) touch_if_present=not args.continue_capture)

@ -13,6 +13,7 @@ MODULE_DESCRIPTION = '''Run analysis of what has already been captured:
Usage: Usage:
infer -- analyze infer -- analyze
infer --out <capture_folder> -- analyze''' infer --out <capture_folder> -- analyze'''
LANG = ['clang', 'java']
def gen_instance(*args): def gen_instance(*args):

@ -17,6 +17,7 @@ ant [options] [target]
Analysis examples: Analysis examples:
infer -- ant compile''' infer -- ant compile'''
LANG = ['java']
def gen_instance(*args): def gen_instance(*args):
return AntCapture(*args) return AntCapture(*args)

@ -26,6 +26,7 @@ buck [options] [target]
Analysis examples: Analysis examples:
infer -- buck build HelloWorld''' infer -- buck build HelloWorld'''
LANG = ['clang', 'java']
def gen_instance(*args): def gen_instance(*args):

@ -19,7 +19,7 @@ gradle [options] [task]
Analysis examples: Analysis examples:
infer -- gradle build infer -- gradle build
infer -- ./gradlew build''' infer -- ./gradlew build'''
LANG = ['java']
def gen_instance(*args): def gen_instance(*args):

@ -19,6 +19,7 @@ javac <options> <source files>
Analysis examples: Analysis examples:
infer -- javac srcfile.java infer -- javac srcfile.java
infer -- /path/to/javac srcfile.java''' infer -- /path/to/javac srcfile.java'''
LANG = ['java']
def gen_instance(*args): def gen_instance(*args):

@ -24,6 +24,7 @@ Analysis examples:
infer -- make all infer -- make all
infer -- clang -c srcfile.m infer -- clang -c srcfile.m
infer -- gcc -c srcfile.c''' infer -- gcc -c srcfile.c'''
LANG = ['clang']
ALIASED_COMMANDS = ['clang', 'clang++', 'cc', 'gcc', 'g++'] ALIASED_COMMANDS = ['clang', 'clang++', 'cc', 'gcc', 'g++']
BUILD_COMMANDS = ['cmake', 'configure', 'make', 'waf'] BUILD_COMMANDS = ['cmake', 'configure', 'make', 'waf']

@ -18,6 +18,8 @@ mvn [options] [task]
Analysis examples: Analysis examples:
infer -- mvn build''' infer -- mvn build'''
LANG = ['java']
def gen_instance(*args): def gen_instance(*args):
return MavenCapture(*args) return MavenCapture(*args)

@ -21,6 +21,7 @@ xcodebuild [options]
Analysis examples: Analysis examples:
infer -- xcodebuild -target HelloWorldApp -sdk iphonesimulator infer -- xcodebuild -target HelloWorldApp -sdk iphonesimulator
infer -- xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld''' infer -- xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld'''
LANG = ['clang']
CLANG_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY, 'clang') CLANG_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY, 'clang')
CLANGPLUSPLUS_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY, CLANGPLUSPLUS_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY,

@ -44,7 +44,7 @@ let active_procedure_checkers () =
let l = let l =
[ [
Checkers.callback_print_c_method_calls, false; Checkers.callback_print_c_method_calls, false;
CheckDeadCode.callback_check_dead_code, checkers_enabled; CheckDeadCode.callback_check_dead_code, false;
] in ] in
IList.map (fun (x, y) -> (x, y, Some Config.Clang)) l in IList.map (fun (x, y) -> (x, y, Some Config.Clang)) l in

@ -0,0 +1,18 @@
(*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*)
open! Utils
(* val active_procedure_checkers : unit -> *)
(* (Callbacks.proc_callback_t * bool * Config.language option) list *)
(* val active_cluster_checkers : unit -> *)
(* (Callbacks.cluster_callback_t * bool * Config.language option) list *)
val register : unit -> unit
Loading…
Cancel
Save