From f2a5810141b82d8dd96445e403d1080ef1872706 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 13 Dec 2016 10:35:05 -0800 Subject: [PATCH] [clang] remove InferClang command from generated frontend debug scripts Summary: The debug script wants to run InferClang on the file at hand, but that often involves running a -cc1 command with InferClang, which is no longer supported. This removes this functionality. The debug script now only dumps the AST to biniou and its text representation. Reviewed By: dulmarod Differential Revision: D4319431 fbshipit-source-id: ef64912 --- .gitignore | 6 +++--- infer/src/clang/Capture.re | 12 +----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 9b08d76d9..f71b3af8d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,9 @@ _build *.exp.test.* *.test.dot duplicates.txt -*.capture.sh -*.capture.bdump -*.capture.biniou +*.ast.sh +*.ast.bdump +*.ast.biniou # generated by oUnit /oUnit-all.cache diff --git a/infer/src/clang/Capture.re b/infer/src/clang/Capture.re index 110386fbb..31f4ef240 100644 --- a/infer/src/clang/Capture.re +++ b/infer/src/clang/Capture.re @@ -132,23 +132,13 @@ let run_plugin_and_frontend source_path frontend clang_args => { let clang_command = ClangCommand.command_to_run (ClangCommand.with_plugin_args clang_args); if debug_mode { /* -cc1 clang commands always set -o explicitly */ - let basename = source_path ^ ".capture"; + let basename = source_path ^ ".ast"; /* Emit the clang command with the extra args piped to InferClang */ let frontend_script_fname = Printf.sprintf "%s.sh" basename; let debug_script_out = open_out frontend_script_fname; let debug_script_fmt = Format.formatter_of_out_channel debug_script_out; let biniou_fname = Printf.sprintf "%s.biniou" basename; Format.fprintf debug_script_fmt "%s \\@\n > %s@\n" clang_command biniou_fname; - let infer_clang_options = - String.concat - sep::"^" - (Option.to_list (Sys.getenv CLOpt.args_env_var) @ ["--clang-biniou-file", biniou_fname]); - Format.fprintf - debug_script_fmt - "%s=\"%s\" %s@\n" - CLOpt.args_env_var - infer_clang_options - (ClangCommand.with_exec Sys.executable_name clang_args |> ClangCommand.command_to_run); Format.fprintf debug_script_fmt "bdump -x -d \"%s/clang_ast.dict\" -w '!!DUMMY!!' %s \\@\n > %s.bdump"