From 6b793a34b55ed91a1f46ec677da6e73474998729 Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Tue, 1 Nov 2016 06:03:11 -0700 Subject: [PATCH] [clang] Fix crash in analysis of ios apps with json Reviewed By: jvillard Differential Revision: D4105295 fbshipit-source-id: bdc6570 --- infer/src/clang/ClangCommand.re | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/infer/src/clang/ClangCommand.re b/infer/src/clang/ClangCommand.re index 7d1f9c654..25cbe696f 100644 --- a/infer/src/clang/ClangCommand.re +++ b/infer/src/clang/ClangCommand.re @@ -36,10 +36,6 @@ let plugin_path = fcp_dir /\/ "libtooling" /\/ "build" /\/ "FacebookClangPlugin. let plugin_name = "BiniouASTExporter"; -/** are we running as Apple's clang? */ -let has_apple_clang = Config.fcp_apple_clang != None; - - /** whether to amend include search path with C++ model headers */ let infer_cxx_models = Config.cxx_experimental; @@ -170,7 +166,11 @@ let with_plugin_args args => { YojsonASTExporter plugin are used. Since the -plugin argument disables the generation of .o files, we invoke apple clang again to generate the expected artifacts. This will keep xcodebuild plus all the sub-steps happy. */ - if has_apple_clang {"-plugin"} else {"-add-plugin"}, + if (has_flag args "-fmodules") { + "-plugin" + } else { + "-add-plugin" + }, plugin_name, "-plugin-arg-" ^ plugin_name, "-",