[clang] Remove INFER_XX environment variable

Summary:
InferClang knows what to do if its name ends in ++.  So it is not
necessary to pass whether or not the original clang executable ended in
++ to InferClang using the the INFER_XX environment variable.  Instead,
create an InferClang++ symbolic link and make the clang wrapper call
either InferClang or InferClang++ as needed.

Reviewed By: jvillard

Differential Revision: D4078416

fbshipit-source-id: 3b5d5d0
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent 622366269d
commit 698ebe8049

1
.gitignore vendored

@ -67,6 +67,7 @@ buck-out/
#other
/infer/bin/InferAnalyze
/infer/bin/InferClang
/infer/bin/InferClang++
/infer/bin/InferJava
/infer/bin/InferPrint
/infer/bin/InferStatsAggregator

@ -268,6 +268,8 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C $(INFERCLANG_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
(cd $(DESTDIR)$(libdir)/infer/infer/bin/ && \
$(LN_S) -f $(INFERCLANG_BIN) $(INFERCLANG_BIN)++)
$(INSTALL_PROGRAM) -C $(INFER_BUCK_COMPILATION_DATABASE_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
endif
ifneq ($(XCODE_SELECT),no)

@ -3,7 +3,6 @@
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BIN_PATH="${SCRIPT_PATH}/../../bin"
if [ "${0%++}" != "$0" ]; then INFER_XX="++"; fi
export INFER_XX
if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi
"${BIN_PATH}/InferClang" "$@"
"${BIN_PATH}/InferClang${XX}" "$@"

@ -198,6 +198,7 @@ ifeq ($(BUILD_JAVA_ANALYZERS),yes)
endif
ifeq ($(BUILD_C_ANALYZERS),yes)
$(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
cd $(INFER_BUILD_DIR) && $(LN_S) -f InferClang InferClang++ && cd -
$(COPY) $(INFER_BUILD_DIR)/$(BUCK_COMPILATION_DATABASE_MAIN).native $(INFER_BUCK_COMPILATION_DATABASE_BIN)
endif
ifeq ($(ENABLE_OCAML_ANNOT),yes)

@ -9,14 +9,7 @@
open! Utils;
let () = {
let xx_suffix =
if (string_is_suffix "++" Sys.argv.(0)) {
"++"
} else {
try (Sys.getenv "INFER_XX") {
| Not_found => ""
}
};
let xx_suffix = string_is_suffix "++" Sys.argv.(0) ? "++" : "";
let args = Array.copy Sys.argv;
/* make sure we don't call ourselves recursively */
args.(0) = CFrontend_config.clang_bin xx_suffix;

Loading…
Cancel
Save