def compilations(exec_calls, cc, cxx): """ Needs to filter out commands which are not compiler calls. And those compiler calls shall be compilation (not pre-processing or linking) calls. Plus needs to find the source file name from the arguments. :param exec_calls: iterator of executions :param cc: user specified C compiler name :param cxx: user specified C++ compiler name :return: stream of formatted compilation database entries """ for call in exec_calls: for entry in Compilation.from_call(call, cc, cxx): yield entry
def compilations(exec_calls, cc, cxx): """ Needs to filter out commands which are not compiler calls. And those compiler calls shall be compilation (not pre-processing or linking) calls. Plus needs to find the source file name from the arguments. :param exec_calls: iterator of executions :param cc: user specified C compiler name :param cxx: user specified C++ compiler name :return: stream of formatted compilation database entries """ for call in exec_calls: for entry in Compilation.from_call(call, cc, cxx): yield entry
def analyze_compiler_wrapper(result, execution): """ Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. """ # don't run analyzer when compilation fails. or when it's not requested. if result or not os.getenv(ENVIRONMENT_KEY): return # collect the needed parameters from environment parameters = json.loads(os.environ[ENVIRONMENT_KEY]) # don't run analyzer when the command is not a compilation. # (filtering non compilations is done by the generator.) for entry in Compilation.from_call(execution): current = dict(entry.to_analyzer(), **parameters) logging_analyzer_output(run(current))
def analyze_build_wrapper(**kwargs): """ Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. """ # don't run analyzer when compilation fails. or when it's not requested. if kwargs['result'] or not os.getenv(ENVIRONMENT_KEY): return # collect the needed parameters from environment parameters = json.loads(os.environ[ENVIRONMENT_KEY]) # don't run analyzer when the command is not a compilation. # (filtering non compilations is done by the generator.) for entry in Compilation.from_call(kwargs['execution']): current = dict(entry.to_analyzer(), **parameters) logging_analyzer_output(run(current))