Reviewed By: jberdine Differential Revision: D4124802 fbshipit-source-id: bb41b8bmaster
parent
a8129be763
commit
bf14034289
@ -1,36 +0,0 @@
|
|||||||
import util
|
|
||||||
|
|
||||||
# Copyright (c) 2016 - 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.
|
|
||||||
|
|
||||||
from inferlib import config, utils
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
MODULE_NAME = 'clang-compilation-database'
|
|
||||||
MODULE_DESCRIPTION = '''Run analysis of code built with the compilation database proided:
|
|
||||||
clang-compilation-database db.json'''
|
|
||||||
|
|
||||||
# This creates an empty argparser for the module, which provides only
|
|
||||||
# description/usage information and no arguments.
|
|
||||||
create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME)
|
|
||||||
|
|
||||||
|
|
||||||
def gen_instance(*args):
|
|
||||||
return ClangCompilationDatabase(*args)
|
|
||||||
|
|
||||||
|
|
||||||
class ClangCompilationDatabase:
|
|
||||||
def __init__(self, args, cmd):
|
|
||||||
self.args = args
|
|
||||||
self.cmd = cmd
|
|
||||||
|
|
||||||
def capture(self):
|
|
||||||
args = self.cmd
|
|
||||||
cmd = [utils.get_cmd_in_bin_dir('InferBuckCompilationDatabase')]
|
|
||||||
cmd += ['--clang-compilation-database', args[1]]
|
|
||||||
print(cmd)
|
|
||||||
return subprocess.check_call(cmd)
|
|
@ -0,0 +1,18 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) 2016 - 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.
|
||||||
|
*)
|
||||||
|
|
||||||
|
(** capture_files_in_database file runs the capture of the files for which
|
||||||
|
we have compilation commands in the database. If the option changed-files-index
|
||||||
|
is passed, we only capture the files there *)
|
||||||
|
val capture_files_in_database : string list -> unit
|
||||||
|
|
||||||
|
(** Gets the compilation database files that contain the compilation given by the
|
||||||
|
buck command. It will be the compilation of the passed targets only or also
|
||||||
|
the dependencies according to the flag --use-compilation-database deps | no-deps *)
|
||||||
|
val get_compilation_database_files_buck : unit -> string list
|
Loading…
Reference in new issue