From 89e39623478fb932e3d262cb248cb92c7160c402 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Tue, 5 Apr 2016 05:21:26 -0700 Subject: [PATCH] Remove source file filtering in clang_wrapper Summary:public Remove option to filter source files from being analysed from clang wrapper. The option is unused and there should be better mechanism to do so if we need it. This will slightly simplify the script and allow to analyze files that are from outside of "blessed" extensions (such as .cxx or .hpp) Reviewed By: dulmarod Differential Revision: D3126330 fb-gh-sync-id: 1628913 fbshipit-source-id: 1628913 --- .../lib/clang_wrappers/clang_general_wrapper | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/infer/lib/clang_wrappers/clang_general_wrapper b/infer/lib/clang_wrappers/clang_general_wrapper index 72a4bce7b..f1d6e5412 100755 --- a/infer/lib/clang_wrappers/clang_general_wrapper +++ b/infer/lib/clang_wrappers/clang_general_wrapper @@ -22,9 +22,6 @@ PLUGIN_PATH="${SCRIPT_DIR}/../../../${CLANG_PLUGIN_REL_PATH}" PLUGIN_NAME="BiniouASTExporter" # output directory of the plugin RESULTS_DIR="${FCP_RESULTS_DIR}" -# space-separated list of source file extensions to compile, where the plugin is needed -# e.g. EXTENSIONS="c cpp m mm" (*note* no dots needed) -EXTENSIONS="${FCP_EXTENSIONS}" # this forces the wrapper to invoke get_standard_commandline_args to get # a more precise clang command with all the arguments in the right place (slow) USE_STD_CLANG_CMD="${FCP_USE_STD_CLANG_CMD}" @@ -59,15 +56,6 @@ CWD=$(pwd) CWD="${CWD%/}" [ ! -d "$RESULTS_DIR" ] && mkdir -p "$RESULTS_DIR" -# If no extensions provided, will use default ones (c, h, cc, cpp, m, mm) -if [ -z "$EXTENSIONS" ]; then - EXTENSIONS="c h cc cpp m mm" -fi - -# regular expression for grep to look for specific extensions -# (for example c,h,m files) -EXTENSIONS_REGEX="\.($(echo $EXTENSIONS | tr ' ' '|'))$" - # Functions function get_option_argument { # retrieves the value passed to an argument of a clang command @@ -107,15 +95,13 @@ then # get the source file name if [ -n "$USE_STD_CLANG_CMD" ]; then # the source file is at the end of the command, match it with the wanted extensions - SOURCE_FILE=$(echo ${INPUT_ARGUMENTS[${#INPUT_ARGUMENTS[@]} - 1]} \ - | grep -i -E "$EXTENSIONS_REGEX") + SOURCE_FILE=$(echo ${INPUT_ARGUMENTS[${#INPUT_ARGUMENTS[@]} - 1]}) else # in this case we search for the argument after -c, match it with the wanted extensions - SOURCE_FILE=$(get_option_argument "-c" "${INPUT_ARGUMENTS[@]}" \ - | grep -i -E "$EXTENSIONS_REGEX") + SOURCE_FILE=$(get_option_argument "-c" "${INPUT_ARGUMENTS[@]}") fi - if [ -n "$SOURCE_FILE" ] + if [ -f "$SOURCE_FILE" ] then # (t7400979) this is a workaround to avoid that clang crashes when the -fmodules flag # and the YojsonASTExporter plugin are used. Since the -plugin argument disables