From 3df1e52928b966582445f9a51e32bf22543111d1 Mon Sep 17 00:00:00 2001 From: Martino Luca Date: Fri, 20 Oct 2017 10:59:21 -0700 Subject: [PATCH] [Buck][compilation-database] Do not run clang command that cannot be attached to the frontend Reviewed By: jvillard Differential Revision: D6100439 fbshipit-source-id: e52c4cb --- infer/src/clang/Capture.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/infer/src/clang/Capture.ml b/infer/src/clang/Capture.ml index dd22b2ff6..f66240b13 100644 --- a/infer/src/clang/Capture.ml +++ b/infer/src/clang/Capture.ml @@ -171,6 +171,10 @@ let capture clang_cmd = (* this command compiles some code; replace the invocation of clang with our own clang and plugin *) cc1_capture clang_cmd + else if Option.is_some Config.buck_compilation_database then + (* when running with buck's compilation-database, skip commands where frontend cannot be + attached, as they may cause unnecessary compilation errors *) + () else (* Non-compilation (eg, linking) command. Run the command as-is. It will not get captured further since `clang -### ...` will only output commands that invoke binaries using their